diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-04-27 23:03:20 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-04-27 23:08:17 +0200 |
commit | e29b5744132d7dfb2989c70d4255840126d6ad19 (patch) | |
tree | 66a539220cb6a637eef52b00f42cdc1b0bdf99e0 /tests/custom | |
parent | 8469c4b1be228f42c46f08852f028f7801b93cc9 (diff) |
lib: fix uc_split() quirks
- Ensure that split by string produces an initial empty string in the
result array when the string to split starts with the split substring
- Ensure that split by string produces a trailing empty string in the
result array when the string to split ends with the split substring
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests/custom')
-rw-r--r-- | tests/custom/03_bugs/13_split_by_string_leading_trailing | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/custom/03_bugs/13_split_by_string_leading_trailing b/tests/custom/03_bugs/13_split_by_string_leading_trailing new file mode 100644 index 0000000..10a6062 --- /dev/null +++ b/tests/custom/03_bugs/13_split_by_string_leading_trailing @@ -0,0 +1,11 @@ +When splitting a string, the existing uc_split() implementation failed +to produce an empty leading and trailing result array element when the +subject string started or ended with a delimitter. + +-- Expect stdout -- +[ "", "foo", "" ] +-- End -- + +-- Testcase -- +{{ split("/foo/", "/") }} +-- End -- |