Files
mercury/tests/hard_coded/string_split.exp
Peter Wang abb1e7d578 Fix an off-by-one bug in string.split_at_separator.
Estimated hours taken: 1
Branches: main

library/string.m:
	Fix an off-by-one bug in string.split_at_separator.  The index in the
	initial call to split_at_separator2 was one past the end of the
	string, which worked in the C backends because strings are NUL
	terminated.

	Rename split_at_separator2 to split_at_separator_2 and make it more
	readable.

tests/hard_coded/string_split.exp:
tests/hard_coded/string_split.m:
	Add a couple of cases which seem more likely to fail with an incorrect
	implementation.
2007-06-06 02:09:45 +00:00

9 lines
179 B
Plaintext

!
hello:world:how:are:you!
hello<tab>world<tab>how<tab>are<tab><tab>you!
user<tab>group<tab>id1<tab>id2
x<tab>ay<tab>az
x<tab>a <tab>aax <tab> x
col1<tab>col2:val2<tab>col3<tab>