summary refs log tree commit diff stats
path: root/tests/stdlib/tsplit2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/stdlib/tsplit2.nim')
-rw-r--r--tests/stdlib/tsplit2.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/stdlib/tsplit2.nim b/tests/stdlib/tsplit2.nim
new file mode 100644
index 000000000..5c4245d54
--- /dev/null
+++ b/tests/stdlib/tsplit2.nim
@@ -0,0 +1,19 @@
+discard """
+  file: "tsplit2.nim"
+  output: "true"
+"""
+import strutils
+
+var s = ""
+for w in split("|abc|xy|z", {'|'}):
+  s.add("#")
+  s.add(w)
+
+try:
+  discard "hello".split("")
+  echo "false"
+except ValueError:
+  echo "true"
+
+#OUT true
+