Fixes #3829. As reported on Zulip (both [recently](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/current.20definition.20of.20.60String.2EsplitOn.60.20is.20incorrect/near/430930535) and [a year ago](https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/should.20we.20redefine.20.60String.2EsplitOnAux.60.3F/near/365899332)), `String.splitOn` has a bug when dealing with separators of more than one character (which are luckily rare). The code change here is very small, replacing a `i` with `i - j`, but it makes termination more complex so that's where the rest of the line count goes.
18 lines
307 B
Text
18 lines
307 B
Text
6
|
||
"cd"
|
||
""
|
||
2
|
||
{ byteIdx := 0 }
|
||
{ byteIdx := 2 }
|
||
{ byteIdx := 4 }
|
||
String.Iterator.mk "αacc" { byteIdx := 2 }
|
||
{ byteIdx := 6 }
|
||
["0", ""]
|
||
["0", ""]
|
||
["ab", "ab"]
|
||
["", "", "c", "cαα", "cα"]
|
||
["αb", "bcαα", ""]
|
||
["here", "is", "some", "text", ""]
|
||
["here is ", " text "]
|
||
["here is some text "]
|
||
["", "bac", "c"]
|