diff options
Diffstat (limited to 'tests/accept')
-rwxr-xr-x | tests/accept/compile/tmodulealias.nim | 17 | ||||
-rwxr-xr-x | tests/accept/run/spec.csv | 1 | ||||
-rwxr-xr-x | tests/accept/run/tlenopenarray.nim | 5 | ||||
-rwxr-xr-x | tests/accept/run/tstrutil.nim | 4 |
4 files changed, 27 insertions, 0 deletions
diff --git a/tests/accept/compile/tmodulealias.nim b/tests/accept/compile/tmodulealias.nim new file mode 100755 index 000000000..1154cb99d --- /dev/null +++ b/tests/accept/compile/tmodulealias.nim @@ -0,0 +1,17 @@ + + +when defined(windows): + import winlean +else: + import posix + +when defined(Windows): + template orig: expr = + winlean +else: + template orig: expr = + posix + +proc socket(domain, typ, protocol: int): int = + result = orig.socket(ord(domain), ord(typ), ord(protocol))) + diff --git a/tests/accept/run/spec.csv b/tests/accept/run/spec.csv index 79a03776a..0dc9a4baa 100755 --- a/tests/accept/run/spec.csv +++ b/tests/accept/run/spec.csv @@ -27,6 +27,7 @@ tisopr.nim;falsetrue titer2.nim;123 titer3.nim;1231 titer5.nim;abcxyz +tlenopenarray.nim;1 tlowhigh.nim;10 tmatrix.nim;111 tmultim1.nim;7 diff --git a/tests/accept/run/tlenopenarray.nim b/tests/accept/run/tlenopenarray.nim new file mode 100755 index 000000000..9731cb4f2 --- /dev/null +++ b/tests/accept/run/tlenopenarray.nim @@ -0,0 +1,5 @@ + +# len(x) --> len([x]) --> match! +echo len(1_000_000) #OUT 1 + + diff --git a/tests/accept/run/tstrutil.nim b/tests/accept/run/tstrutil.nim index 0468dfa0c..affe6e58d 100755 --- a/tests/accept/run/tstrutil.nim +++ b/tests/accept/run/tstrutil.nim @@ -11,6 +11,10 @@ proc main() = for p in split("/home/a1:xyz:/usr/bin", {':'}): write(stdout, p) +assert(insertSep($1000_000) == "1_000_000") +assert(insertSep($232) == "232") +assert(insertSep($12345, ',') == "12,345") +assert(insertSep($0) == "0") assert(editDistance("prefix__hallo_suffix", "prefix__hallo_suffix") == 0) assert(editDistance("prefix__hallo_suffix", "prefix__hallo_suffi1") == 1) |