diff options
author | Christian Schneider | 2015-08-12 15:27:39 +0200 |
---|---|---|
committer | Christian Schneider | 2015-08-12 15:27:39 +0200 |
commit | 1c0a580ec4de036530b08a83d5ddc2d915bdfd0b (patch) | |
tree | da17deffd92927957246b5f3cb13393c853f0446 /tests/it.t | |
parent | 0bb7f6148acb2a4a4d2caaa83c9ffa5b27aa8e1c (diff) | |
parent | 79d5a50477ed74940484a5ca046dfa04adce1550 (diff) | |
download | itools-1c0a580ec4de036530b08a83d5ddc2d915bdfd0b.tar.gz itools-1c0a580ec4de036530b08a83d5ddc2d915bdfd0b.tar.bz2 itools-1c0a580ec4de036530b08a83d5ddc2d915bdfd0b.zip |
Merge branch 'master' into cs/php7
Diffstat (limited to 'tests/it.t')
-rwxr-xr-x | tests/it.t | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -58,25 +58,25 @@ match( match( '\bblah\b', 'ablahc', - false, + null, 'don\'t match \b at word chars' ); match( '\bblah\b', 'Üblahä', - false, + null, 'don\'t match \b at umlaute' ); match( '\Bblah\B', ' blah ', - false, + null, 'don\'t match \B at spaces' ); match( '\Bblah\B', 'blah', - false, + null, 'don\'t match \B at end of string' ); @@ -112,7 +112,7 @@ match( match( '\ba', 'äa', - '', + null, '\b must know umlauts' ); @@ -133,19 +133,19 @@ $escapedwordregex = preg_replace('|[\\\\/]|', '', $escapedwordregex); match( '\\\\w+', $escapedwordregex, - false, + null, 'don\'t parse \w in \\\\w at beginning (no match)' ); match( 'aaa\\\\w+', 'aaa' . $escapedwordregex, - false, + null, 'don\'t parse \w in \\\\w after chars (no match)' ); match( '\\\\\\\\w+', '\\' . $escapedwordregex, - false, + null, 'don\'t parse \w in \\\\\\\w (no match)' ); @@ -157,7 +157,7 @@ match( match( '[\w]+', '[[[]]]---', - false, + null, 'replace \w in [\w] correctly (no match)' ); @@ -169,7 +169,7 @@ match( match( '[\\\\w]+', ' blabergna ', - false, + null, 'don\'t parse \w in [\\\\w] (no match)' ); @@ -239,9 +239,9 @@ match( match( 'abc', "aBc", - false, + null, "set case sensitivity by parameter", - array('casesensitive' => 1), + array('casesensitive' => 1) ); match( @@ -309,7 +309,7 @@ is(it::replace(array('a' => "b", 'b' => "c"), "a"), "c"); is(it::grep('ismatch', array('ismatch', 'isnomatch')), array('ismatch'), 'grep with simple regex'); is(it::grep('!', array('ismatch!', 'isnomatch')), array('ismatch!'), '! in regex'); -is(it::grep('lower|UPPER', array('lower', 'LOWER', 'upper', 'UPPER'), 'casesensitive' => 1), array(0 => 'lower', 3 => 'UPPER'), 'set casesensitive'); +is(it::grep('lower|UPPER', array('lower', 'LOWER', 'upper', 'UPPER'), array('casesensitive' => 1)), array(0 => 'lower', 3 => 'UPPER'), 'set casesensitive'); is(it::grep('match', array('foo' => 'match', 'bar' => 'gna')), array('foo' => 'match'), 'with keys'); setlocale(LC_CTYPE, $oldlocale); @@ -389,6 +389,7 @@ is(it::any2utf8("a💚b"), "a💚b", "it::any2utf8 correctly handles 4-byte utf- is(it::any2utf8(array("foo", utf8_decode("bär"))), array("foo", "bär"), "any2utf8 on arrays"); is(it::any2utf8(array("foo", array(utf8_decode("bär")))), array("foo", array("bär")), "any2utf8 on recursive arrays"); is(it::any2utf8(array(1, true, false, null)), array(1, true, false, null), "any2utf8 should leave types alone"); +is(it::any2utf8(array(utf8_decode('Müller') => utf8_decode('Müller'))), array('Müller' => 'Müller'), "it::any2utf8 latin1 keys"); foreach (array($dummy, false, true, null, 1, "a", "Ä", "/", array()) as $var) is(it::json_decode(it::json_encode($var)), $var); |