Skip to content

Commit

Permalink
Test split skip-empty skips all empty chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Mar 8, 2017
1 parent 81c9ff5 commit a8a7ff1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S32-str/split.t
Expand Up @@ -4,7 +4,7 @@ use Test;

# L<S32-setting-library/Str"=item split">

plan 61;
plan 62;

# Legend:
# r result
Expand Down Expand Up @@ -537,3 +537,12 @@ subtest '.split works on Cool same as it works on Str' => {

# RT #130904
is-deeply "A-B C".split([" ", "-"]), ("A", "B", "C").Seq, "Split with alternates completes and doesn't give an exception";

# RT #130955
subtest 'split skip-empty skips all empty chunks' => {
my @tests = '' => ';', '' => '', '' => rx/^/, '' => /$/, ';' => ';';
plan +@tests;
cmp-ok .key.split(.value, :skip-empty), '==', 0,
"{.key}.split({.value.perl}, :skip-empty)"
for @tests;
}

0 comments on commit a8a7ff1

Please sign in to comment.