[svn:parrot] r47674 - trunk/t/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Thu Jun 17 16:08:49 UTC 2010


Author: NotFound
Date: Thu Jun 17 16:08:49 2010
New Revision: 47674
URL: https://trac.parrot.org/parrot/changeset/47674

Log:
test for ArrayIterator wrong direction

Modified:
   trunk/t/pmc/arrayiterator.t

Modified: trunk/t/pmc/arrayiterator.t
==============================================================================
--- trunk/t/pmc/arrayiterator.t	Thu Jun 17 15:52:39 2010	(r47673)
+++ trunk/t/pmc/arrayiterator.t	Thu Jun 17 16:08:49 2010	(r47674)
@@ -23,11 +23,12 @@
 .sub main :main
     .include 'test_more.pir'
 
-    plan(21)
+    plan(22)
 
     iterate_forward() # 8 tests
     iterate_backward() # 6 tests
     iterate_backward_string() # 6 test
+    iterate_wrong() # 1 test
     iterator_init() # 1 test
 .end
 
@@ -116,6 +117,26 @@
     ok($I0, "Shifting from finished iterator throws exception - string")
 .end
 
+.sub 'iterate_wrong'
+    .local pmc foo, it, ex
+    .local int r
+
+    foo = new ['FixedIntegerArray'], 1
+
+    it = iter foo
+    push_eh catch_wrong
+    it = 42 # Let's hope we'll never have such direction
+    r = 0
+    goto dotest
+catch_wrong:
+    .get_results(ex)
+    finalize ex
+    r = 1
+dotest:
+    pop_eh
+    ok(r, "Caught wrong direction")
+.end
+
 .sub 'iterator_init'
     .local pmc it, e
     .local string msg


More information about the parrot-commits mailing list