mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
* 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>
This commit is contained in:
6
tests/stdlib/tstrimpl.nim
Normal file
6
tests/stdlib/tstrimpl.nim
Normal file
@@ -0,0 +1,6 @@
|
||||
import std/private/strimpl
|
||||
|
||||
doAssert find(cstring"Hello Nim", cstring"Nim") == 6
|
||||
doAssert find(cstring"Hello Nim", cstring"N") == 6
|
||||
doAssert find(cstring"Hello Nim", cstring"I") == -1
|
||||
doAssert find(cstring"Hello Nim", cstring"O") == -1
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user