com php-src: Forgot to add test: Zend/tests/generators/finally _uninterrupted.phpt
| From: | Gustavo André dos Santos Lopes | Date: | Mon, 13 Aug 2012 17:24:44 +0000 |
| Subject: | com php-src: Forgot to add test: Zend/tests/generators/finally _uninterrupted.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70030@lists.php.net to get a copy of this message | ||
Commit: 7195a5b3768e519b8f50d131a8c7041a0b57959e
Author: Nikita Popov <nikic@php.net> Mon, 13 Aug 2012 19:24:44 +0200
Parents: ae716939eb500f962336d37b96069cb7452c25df
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7195a5b3768e519b8f50d131a8c7041a0b57959e
Log:
Forgot to add test
Changed paths:
A Zend/tests/generators/finally_uninterrupted.phpt
Diff:
diff --git a/Zend/tests/generators/finally_uninterrupted.phpt
b/Zend/tests/generators/finally_uninterrupted.phpt
new file mode 100644
index 0000000..64c9438
--- /dev/null
+++ b/Zend/tests/generators/finally_uninterrupted.phpt
@@ -0,0 +1,28 @@
+--TEST--
+Use of finally in generator without interrupt
+--FILE--
+<?php
+
+function gen() {
+ try {
+ throw new Exception;
+ } finally {
+ echo "finally run\n";
+ }
+
+ yield; // force generator
+}
+
+$gen = gen();
+$gen->rewind(); // force run
+
+?>
+--EXPECTF--
+finally run
+
+Fatal error: Uncaught exception 'Exception' in %s:%d
+Stack trace:
+#0 [internal function]: gen()
+#1 %s(%d): Generator->rewind()
+#2 {main}
+ thrown in %s on line %d