[svn:parrot] r47531 - trunk/t/pmc
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Thu Jun 10 12:37:44 UTC 2010
Author: NotFound
Date: Thu Jun 10 12:37:44 2010
New Revision: 47531
URL: https://trac.parrot.org/parrot/changeset/47531
Log:
ByteBuffer test with content invalid for the charset/encoding asked
Modified:
trunk/t/pmc/bytebuffer.t
Modified: trunk/t/pmc/bytebuffer.t
==============================================================================
--- trunk/t/pmc/bytebuffer.t Thu Jun 10 12:36:23 2010 (r47530)
+++ trunk/t/pmc/bytebuffer.t Thu Jun 10 12:37:44 2010 (r47531)
@@ -21,7 +21,7 @@
.sub 'main' :main
.include 'test_more.pir'
- plan(23)
+ plan(24)
test_init()
test_set_string()
@@ -279,12 +279,24 @@
s = bb.'get_string'('ascii', '???INVALID eNCODING===')
pop_eh
ok(0, "get_string with invalid encoding should throw")
- goto end
+ goto check_content
catch_encoding:
.get_results(ex)
finalize ex
pop_eh
ok(1, "get_string with invalid encoding throws")
+check_content:
+ bb[0] = 128 # Out of ascii range
+ push_eh catch_content
+ s = bb.'get_string'('ascii', 'fixed_8')
+ pop_eh
+ ok(0, "get_string with invalid content should throw")
+ goto end
+catch_content:
+ .get_results(ex)
+ finalize ex
+ pop_eh
+ ok(1, "get_string with invalid content throws")
end:
.end
More information about the parrot-commits
mailing list