summary refs log tree commit diff stats
path: root/tests/newconfig
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-09 14:26:00 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-09 14:26:00 +0200
commit5e82ffc8d560dd3b2b7bbda034e5436fb036c20d (patch)
tree039f8112cb5c42ba76c883d62a5b8b4bb69f7dc6 /tests/newconfig
parent66f37971e92ee9a573d1dd2fb82d5120e6ccb0ed (diff)
downloadNim-5e82ffc8d560dd3b2b7bbda034e5436fb036c20d.tar.gz
Nimscript: added support for 'patchFile'
Diffstat (limited to 'tests/newconfig')
-rw-r--r--tests/newconfig/mymath.nim4
-rw-r--r--tests/newconfig/tfoo.nim6
-rw-r--r--tests/newconfig/tfoo.nims2
3 files changed, 10 insertions, 2 deletions
diff --git a/tests/newconfig/mymath.nim b/tests/newconfig/mymath.nim
new file mode 100644
index 000000000..5668b448b
--- /dev/null
+++ b/tests/newconfig/mymath.nim
@@ -0,0 +1,4 @@
+
+
+proc ln*(x: float): float =
+  return 0.5
diff --git a/tests/newconfig/tfoo.nim b/tests/newconfig/tfoo.nim
index d593d4a75..2e10167b1 100644
--- a/tests/newconfig/tfoo.nim
+++ b/tests/newconfig/tfoo.nim
@@ -1,10 +1,12 @@
 discard """
   cmd: "nim default $file"
-  output: '''hello world!'''
+  output: '''hello world! 0.5'''
   msg: '''[NimScript] exec: gcc -v'''
 """
 
 when not defined(definedefine):
   {.fatal: "wrong nim script configuration".}
 
-echo "hello world!"
+import math
+
+echo "hello world! ", ln 2.0
diff --git a/tests/newconfig/tfoo.nims b/tests/newconfig/tfoo.nims
index 8d1461c78..f87aba619 100644
--- a/tests/newconfig/tfoo.nims
+++ b/tests/newconfig/tfoo.nims
@@ -11,6 +11,8 @@ import ospaths
 warning("uninit", off)
 hint("processing", off)
 
+patchFile("stdlib", "math", "mymath")
+
 task listDirs, "lists every subdirectory":
   for x in listDirs("."):
     echo "DIR ", x