lean4-htt/tests/lean/string_imp.lean.expected.out
Mario Carneiro e41cd310e9
fix: String.splitOn bug (#3832)
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.
2024-04-04 09:30:53 +00:00

18 lines
307 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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"]