summary refs log tree commit diff stats
path: root/tests/stdlib/tstrutils.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-09-29 04:05:41 +0800
committerGitHub <noreply@github.com>2022-09-28 16:05:41 -0400
commit65c2518d5cae79084190dfd9bdfc757572ed2e79 (patch)
tree96330f14f7d619486f900fc276499b42906e09e1 /tests/stdlib/tstrutils.nim
parent919a889ba81b882844a90f65fb644bf6266316d7 (diff)
downloadNim-65c2518d5cae79084190dfd9bdfc757572ed2e79.tar.gz
fix #19500; remove find optimization [backport: 1.6] (#19714)
* remove find optimization

close #19500

* save find to std

* add simple tests

* Apply suggestions from code review

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: sandytypical <43030857+xflywind@users.noreply.github.com>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
Diffstat (limited to 'tests/stdlib/tstrutils.nim')
-rw-r--r--tests/stdlib/tstrutils.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/stdlib/tstrutils.nim b/tests/stdlib/tstrutils.nim
index 0e6384d7e..32929ef17 100644
--- a/tests/stdlib/tstrutils.nim
+++ b/tests/stdlib/tstrutils.nim
@@ -868,5 +868,10 @@ bar
     doAssert nimIdentNormalize("Foo_bar") == "Foobar"
     doAssert nimIdentNormalize("_Foo_bar") == "_foobar"
 
+  block: # bug #19500
+    doAssert "abc \0 def".find("def") == 6
+    doAssert "abc \0 def".find('d') == 6
+
+
 static: main()
 main()