Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a couple tests for split
Inspired by a bug found by tokuhirom++ . Specifically not SKIPped or
TODO'd so the issue is more visible.
  • Loading branch information
ShimmerFairy committed Oct 30, 2015
1 parent f55436c commit 3185bb0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions S32-str/split.t
Expand Up @@ -45,6 +45,16 @@ plan 53;
q{Str.split: '$', 2};
}

# split on start/end of string
{

is split('|', '|life|universe|everything|').join("-"), "-life-universe-everything-",
"Splitting string where delimiter occurs at start/end has null strings at start/end of list";

is split('|', '|life|universe|the third thing|', 5).join("-"), "-life-universe-the third thing-",
"Splitting string where delimiter occurs at start/end with limit on number of splits";
}

# split on a multi-character delimiter
{
is split(', ', "comma, separated, values").join('|'),
Expand Down

0 comments on commit 3185bb0

Please sign in to comment.