summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorUrban Müller2017-03-30 20:53:20 +0200
committerUrban Müller2017-03-30 20:53:20 +0200
commit2672253419813f6457366a66aaf93faea48f43f6 (patch)
tree78767856301d854edb2deeb613913457cc572ea2 /tests
parenta4f1a3241fda15df244cf77613e1405a8d50810b (diff)
downloaditools-2672253419813f6457366a66aaf93faea48f43f6.tar.gz
itools-2672253419813f6457366a66aaf93faea48f43f6.tar.bz2
itools-2672253419813f6457366a66aaf93faea48f43f6.zip
it::split as frontend for preg_split()
Diffstat (limited to 'tests')
-rwxr-xr-xtests/it.t8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/it.t b/tests/it.t
index 0c02106..77bab72 100755
--- a/tests/it.t
+++ b/tests/it.t
@@ -442,3 +442,11 @@ is(it::map('2*$v', ['foo' => 1, 'bar' => 2], ['keys' => 'foo']), ['foo' => 2, 'b
is(it::add_dir("foo/bar"), "foo/37/bar");
is(it::add_dir("baz/bar"), "baz/37/bar");
is(it::add_dir("bar"), "./37/bar");
+
+is(it::split("b", "aba"), ["a", "a"]);
+is(it::split("b", "aBa"), ["a", "a"]);
+is(it::split("b", "abba"), ["a", "", "a"]);
+is(it::split("b", "ababa", ['limit' => 2]), ["a", "aba"]);
+is(it::split("b", "abbba", ['no_empty' => true]), ["a", "a"]);
+is(it::split("(b)", "aba", ['delim_capture' => true]), ["a", "b", "a"]);
+is(it::split("b", "aabaa", ['offset_capture' => true]), [["aa", 0], ["aa", 3]]);