StringStream & more stdlib modules support for JS/NimScript (#14095)
* StringStream & more stdlib modules support for JS/NimScript * change back pegs test in line with #14134
This commit is contained in:
parent
d5ed4fba3e
commit
cd9af6b804
22 changed files with 852 additions and 356 deletions
|
|
@ -38,8 +38,8 @@ true
|
|||
"""
|
||||
|
||||
import
|
||||
critbits, sets, strutils, tables, random, algorithm, re, ropes, segfaults,
|
||||
lists, parsesql, streams, os, htmlgen, xmltree, strtabs
|
||||
critbits, cstrutils, sets, strutils, tables, random, algorithm, re, ropes,
|
||||
segfaults, lists, parsesql, streams, os, htmlgen, xmltree, strtabs
|
||||
|
||||
|
||||
block tcritbits:
|
||||
|
|
@ -245,3 +245,24 @@ block txmltree:
|
|||
])
|
||||
])
|
||||
doAssert(y.innerText == "foobar")
|
||||
|
||||
|
||||
block tcstrutils:
|
||||
let s = cstring "abcdef"
|
||||
doAssert s.startsWith("a")
|
||||
doAssert not s.startsWith("b")
|
||||
doAssert s.endsWith("f")
|
||||
doAssert not s.endsWith("a")
|
||||
|
||||
let a = cstring "abracadabra"
|
||||
doAssert a.startsWith("abra")
|
||||
doAssert not a.startsWith("bra")
|
||||
doAssert a.endsWith("abra")
|
||||
doAssert not a.endsWith("dab")
|
||||
|
||||
doAssert cmpIgnoreCase(cstring "FooBar", "foobar") == 0
|
||||
doAssert cmpIgnoreCase(cstring "bar", "Foo") < 0
|
||||
doAssert cmpIgnoreCase(cstring "Foo5", "foo4") > 0
|
||||
|
||||
doAssert cmpIgnoreStyle(cstring "foo_bar", "FooBar") == 0
|
||||
doAssert cmpIgnoreStyle(cstring "foo_bar_5", "FooBar4") > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue