From: Vincent Pit Date: Tue, 26 May 2009 16:09:15 +0000 (+0200) Subject: More tests for uninitialized warnings in ranges X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=933981904d595f4bab92e904b4d426ca07c8ccfc;p=p5sagit%2Fp5-mst-13.2.git More tests for uninitialized warnings in ranges --- diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit index 50e7f50..58db2b2 100644 --- a/t/lib/warnings/9uninit +++ b/t/lib/warnings/9uninit @@ -448,25 +448,79 @@ Use of uninitialized value $g1 in exists at - line 8. use warnings 'uninitialized'; my ($m1, $m2); my ($v, @a); +my ($t, $u) = (1, 1); local $.; -@ma = (1 .. 2); +@ma = (1 .. 2); +@ma = ($t .. 2); @ma = ($m1 .. 2); -@ma = (1 .. $m2); -@ma = ($m1 .. $m2); +@ma = (1 .. $u); +@ma = (1 .. $m2); + +@ma = (1 ... 2); +@ma = ($t ... 2); +@ma = ($m1 ... 2); +@ma = (1 ... $u); +@ma = (1 ... $m2); -$v = (1 .. 2); +$v = (1 .. 2); +$v = ($t .. 2); $v = ($m1 .. 2); -$v = (1 .. $m2); +$v = (1 .. $u); +$v = (1 .. $m2); + +$v = (1 ... 2); +$v = ($t ... 2); +$v = ($m1 ... 2); +$v = (1 ... $u); +$v = (1 ... $m2); +EXPECT +Use of uninitialized value $m1 in range (or flop) at - line 10. +Use of uninitialized value $m2 in range (or flop) at - line 12. +Use of uninitialized value $m1 in range (or flop) at - line 16. +Use of uninitialized value $m2 in range (or flop) at - line 18. +Use of uninitialized value $. in range (or flip) at - line 20. +Use of uninitialized value $. in range (or flop) at - line 21. +Use of uninitialized value $. in range (or flip) at - line 23. +Use of uninitialized value $. in range (or flip) at - line 24. +Use of uninitialized value $. in range (or flip) at - line 26. +Use of uninitialized value $. in range (or flip) at - line 29. +Use of uninitialized value $. in range (or flip) at - line 30. +######## +use warnings 'uninitialized'; +my ($m1, $m2); +my ($v, @a); +my ($t, $u) = (1, 1); + +@ma = ($t .. $u); +@ma = ($m1 .. $u); +@ma = ($t .. $m2); +@ma = ($m1 .. $m2); + +@ma = ($t ... $u); +@ma = ($m1 ... $u); +@ma = ($t ... $m2); +@ma = ($m1 ... $m2); + +$v = ($t .. $u); +$v = ($m1 .. $u); +$v = ($t .. $m2); $v = ($m1 .. $m2); -EXPECT -Use of uninitialized value $m1 in range (or flop) at - line 8. -Use of uninitialized value $m2 in range (or flop) at - line 9. -Use of uninitialized value in range (or flop) at - line 10. -Use of uninitialized value in range (or flop) at - line 10. -Use of uninitialized value $. in range (or flip) at - line 12. -Use of uninitialized value $. in range (or flip) at - line 14. + +$v = ($t ... $u); +$v = ($m1 ... $u); +$v = ($t ... $m2); +$v = ($m1 ... $m2); +EXPECT +Use of uninitialized value $m1 in range (or flop) at - line 7. +Use of uninitialized value $m2 in range (or flop) at - line 8. +Use of uninitialized value in range (or flop) at - line 9. +Use of uninitialized value in range (or flop) at - line 9. +Use of uninitialized value $m1 in range (or flop) at - line 12. +Use of uninitialized value $m2 in range (or flop) at - line 13. +Use of uninitialized value in range (or flop) at - line 14. +Use of uninitialized value in range (or flop) at - line 14. ######## use warnings 'uninitialized'; my ($m1, $v);