]> granicus.if.org Git - php/commitdiff
Update test to test a few more cases and another for calling prev() on a blank DLL.
authorScott MacVicar <scottmac@php.net>
Wed, 17 Jun 2009 13:15:39 +0000 (13:15 +0000)
committerScott MacVicar <scottmac@php.net>
Wed, 17 Jun 2009 13:15:39 +0000 (13:15 +0000)
ext/spl/tests/dllist_010.phpt
ext/spl/tests/dllist_011.phpt [new file with mode: 0644]

index 685f735d6b8a4aed973490e273b3ea39a98f0802..7e389559e2d8a23343be71ee43a03c163f42dd8c 100644 (file)
@@ -10,18 +10,24 @@ $dll->push(4);
 
 
 $dll->rewind();
-echo $dll->current()."\n";
+$dll->prev();
+var_dump($dll->current());
+$dll->rewind();
+var_dump($dll->current());
+$dll->next();
+var_dump($dll->current());
 $dll->next();
 $dll->next();
-echo $dll->current()."\n";
+var_dump($dll->current());
 $dll->prev();
-echo $dll->current()."\n";
+var_dump($dll->current());
 
 ?>
 ===DONE===
-<?php exit(0); ?>
---EXPECTF--
-1
-3
-2
+--EXPECT--
+NULL
+int(1)
+int(2)
+int(4)
+int(3)
 ===DONE===
diff --git a/ext/spl/tests/dllist_011.phpt b/ext/spl/tests/dllist_011.phpt
new file mode 100644 (file)
index 0000000..b9be872
--- /dev/null
@@ -0,0 +1,13 @@
+--TEST--
+SPL: DoublyLinkedList: prev
+--FILE--
+<?php
+$dll = new SplDoublyLinkedList();
+$dll->rewind();
+$dll->prev();
+var_dump($dll->current());
+?>
+===DONE===
+--EXPECT--
+NULL
+===DONE===