summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authortreeform <starplant@gmail.com>2018-04-15 08:34:03 -0700
committerAndreas Rumpf <rumpf_a@web.de>2018-04-15 17:34:03 +0200
commitb98cd3bf348a41778f475e835b86ab9175125789 (patch)
treec85ca2b8270e7dac7b73daf2a128613e188bf984 /tests
parent6795d9931b19d3dc603f374d00363b593ccf6553 (diff)
downloadNim-b98cd3bf348a41778f475e835b86ab9175125789.tar.gz
Fix cmpStrings in js mode (#7604)
Diffstat (limited to 'tests')
-rw-r--r--tests/js/tstringitems.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/js/tstringitems.nim b/tests/js/tstringitems.nim
index 20aed6e8b..ff016642e 100644
--- a/tests/js/tstringitems.nim
+++ b/tests/js/tstringitems.nim
@@ -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)