bugfix: len openarray
This commit is contained in:
parent
2e280eafa8
commit
96b828a386
8 changed files with 74 additions and 13 deletions
17
tests/accept/compile/tmodulealias.nim
Executable file
17
tests/accept/compile/tmodulealias.nim
Executable file
|
|
@ -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)))
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
5
tests/accept/run/tlenopenarray.nim
Executable file
5
tests/accept/run/tlenopenarray.nim
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
|
||||
# len(x) --> len([x]) --> match!
|
||||
echo len(1_000_000) #OUT 1
|
||||
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue