]> granicus.if.org Git - php/commitdiff
- Add test
authorMarcus Boerger <helly@php.net>
Sat, 18 Feb 2006 17:13:39 +0000 (17:13 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 18 Feb 2006 17:13:39 +0000 (17:13 +0000)
ext/unicode/tests/iterator_002.phpt [new file with mode: 0755]

diff --git a/ext/unicode/tests/iterator_002.phpt b/ext/unicode/tests/iterator_002.phpt
new file mode 100755 (executable)
index 0000000..1e3ce74
--- /dev/null
@@ -0,0 +1,35 @@
+--TEST--
+Unicode: Iterator and key()
+--SKIPIF--
+<?php if (!unicode_semantics()) die('skip unicode_semantics=off'); ?>
+--FILE--
+<?php
+
+foreach(new TextIterator("123") as $pos => $char)
+{
+       var_dump($pos);
+       var_dump($char);
+}
+
+foreach(new ReverseTextIterator("123") as $pos => $char)
+{
+       var_dump($pos);
+       var_dump($char);
+}
+
+?>
+===DONE===
+--EXPECTF--
+int(0)
+unicode(1) "1"
+int(1)
+unicode(1) "2"
+int(2)
+unicode(1) "3"
+int(0)
+unicode(1) "3"
+int(1)
+unicode(1) "2"
+int(2)
+unicode(1) "1"
+===DONE===