Skip to content

Commit a48fd2e

Browse files
committed
Read testcases at compile time
1 parent be3b90a commit a48fd2e

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

circle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ dependencies:
2525

2626
test:
2727
override:
28-
- cd test && nim c --path:../src -r test
28+
- nim compile --verbosity:0 --run test/test

test/test.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ var doc, args, expected: string = nil
3838
var in_doc = false
3939
var total, passed = 0
4040
41-
for each_line in "testcases.docopt".lines:
41+
const tests = static_read("testcases.docopt")
42+
for each_line in (tests & "\n\n").split_lines():
4243
var line = each_line.partition("#").left
4344
if not in_doc and line.starts_with("r\"\"\""):
4445
in_doc = true

test/testcases.docopt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,4 +907,3 @@ $ prog -pHOME
907907
r"""Usage: foo (--xx=x|--yy=y)..."""
908908
$ prog --xx=1 --yy=2
909909
{"--xx": ["1"], "--yy": ["2"]}
910-

0 commit comments

Comments
 (0)