Fix cmpStrings in js mode (#7604)

This commit is contained in:
treeform 2018-04-15 08:34:03 -07:00 • committed by Andreas Rumpf
commit b98cd3bf34
2 changed files with 11 additions and 2 deletions

View file

@ -76,3 +76,12 @@ block: # String case of
case s
of "Привет!": discard
else: doAssert(false)
block: # String cmp
var a, b: string
doAssert(cmp(a, b) == 0)
doAssert(cmp("foo", "foo") == 0)
doAssert(cmp("foobar", "foo") == 3)
doAssert(cmp("foo", "foobar") == -3)
doAssert(cmp("fooz", "foog") == 19)
doAssert(cmp("foog", "fooz") == -19)