summary refs log tree commit diff stats
path: root/tests/js/test1.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/test1.nim')
-rw-r--r--tests/js/test1.nim32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/js/test1.nim b/tests/js/test1.nim
index 7f1d346f0..73e7a37ed 100644
--- a/tests/js/test1.nim
+++ b/tests/js/test1.nim
@@ -20,3 +20,35 @@ proc onButtonClick(inputElement: string) {.exportc.} =
 
 onButtonClick(inputElement)
 
+block:
+  var s: string
+  s.add("hi")
+  doAssert(s == "hi")
+
+block:
+  var s: string
+  s.insert("hi", 0)
+  doAssert(s == "hi")
+
+block:
+  var s: string
+  s.setLen(2)
+  s[0] = 'h'
+  s[1] = 'i'
+  doAssert(s == "hi")
+
+block:
+  var s: seq[int]
+  s.setLen(2)
+  doAssert(s == @[0, 0])
+
+block:
+  var s: seq[int]
+  s.insert(2, 0)
+  doAssert(s == @[2])
+
+block:
+  var s: seq[int]
+  s.add(2)
+  doAssert(s == @[2])
+