mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 01:13:30 +00:00
Estimated hours taken: 1
Branches: main
library/string.m:
Fix a bug in string__join_list pointed out by Fergus; the length
calculation and the string copying now use the same logic.
library/tests/hard_coded/join_list.{m,exp}:
A new test case to exercise string__join_list.
library/tests/hard_coded/Mmakefile:
Enable the new test.
37 lines
666 B
Plaintext
37 lines
666 B
Plaintext
|
|
|
|
|
|
|
|
a, b
|
|
a b
|
|
a x b
|
|
ab
|
|
a, b, c
|
|
a b c
|
|
a x b x c
|
|
abc
|
|
a, , c
|
|
a c
|
|
a x x c
|
|
ac
|
|
abc, def, ghi
|
|
abc def ghi
|
|
abc x def x ghi
|
|
abcdefghi
|
|
the, quick, brown, fox, jumped, over, the, lazy, dog
|
|
the quick brown fox jumped over the lazy dog
|
|
the x quick x brown x fox x jumped x over x the x lazy x dog
|
|
thequickbrownfoxjumpedoverthelazydog
|
|
this, is, a, test, to, check, the correctness, of the, join_list , predicate
|
|
|
|
this is a test to check the correctness of the join_list predicate
|
|
|
|
this x is x a x test x to x check x the correctness x of the x join_list x predicate
|
|
|
|
thisisatesttocheckthe correctness of thejoin_list predicate
|
|
|
|
, , , x
|
|
x
|
|
x x x x
|
|
x
|