From 1217eab95042b4d85fbf6baa7f56a559d20800ee Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Wed, 17 Jun 2009 13:15:39 +0000 Subject: [PATCH] Update test to test a few more cases and another for calling prev() on a blank DLL. --- ext/spl/tests/dllist_010.phpt | 22 ++++++++++++++-------- ext/spl/tests/dllist_011.phpt | 13 +++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 ext/spl/tests/dllist_011.phpt diff --git a/ext/spl/tests/dllist_010.phpt b/ext/spl/tests/dllist_010.phpt index 685f735d6b..7e389559e2 100644 --- a/ext/spl/tests/dllist_010.phpt +++ b/ext/spl/tests/dllist_010.phpt @@ -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=== - ---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 index 0000000000..b9be872555 --- /dev/null +++ b/ext/spl/tests/dllist_011.phpt @@ -0,0 +1,13 @@ +--TEST-- +SPL: DoublyLinkedList: prev +--FILE-- +rewind(); +$dll->prev(); +var_dump($dll->current()); +?> +===DONE=== +--EXPECT-- +NULL +===DONE=== -- 2.40.0