[svn:parrot] r41122 - trunk/t/pmc
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Mon Sep 7 18:06:45 UTC 2009
Author: whiteknight
Date: Mon Sep 7 18:06:45 2009
New Revision: 41122
URL: https://trac.parrot.org/parrot/changeset/41122
Log:
[t] add several tests for Namespaces with unicode names. We now officially have more PIR tests for NameSpace PMC then we ever had written in Perl5
Modified:
trunk/t/pmc/namespace-old.t
trunk/t/pmc/namespace.t
Modified: trunk/t/pmc/namespace-old.t
==============================================================================
--- trunk/t/pmc/namespace-old.t Mon Sep 7 18:05:08 2009 (r41121)
+++ trunk/t/pmc/namespace-old.t Mon Sep 7 18:06:45 2009 (r41122)
@@ -6,7 +6,7 @@
use warnings;
use lib qw( . lib ../lib ../../lib );
use Test::More;
-use Parrot::Test tests => 43;
+use Parrot::Test tests => 42;
use Parrot::Config;
=head1 NAME
@@ -23,23 +23,6 @@
=cut
-pir_output_is( <<'CODE', <<'OUT', "unicode namespace, global" );
-.namespace [ unicode:"Fran\xe7ois" ]
-
-.sub 'test'
- print "unicode namespaces are fun\n"
-.end
-
-.namespace []
-
-.sub 'main' :main
- $P0 = get_global [unicode:"Fran\xe7ois"], 'test'
- $P0()
-.end
-CODE
-unicode namespaces are fun
-OUT
-
my $temp_a = "temp_a";
my $temp_b = "temp_b";
Modified: trunk/t/pmc/namespace.t
==============================================================================
--- trunk/t/pmc/namespace.t Mon Sep 7 18:05:08 2009 (r41121)
+++ trunk/t/pmc/namespace.t Mon Sep 7 18:06:45 2009 (r41122)
@@ -56,7 +56,7 @@
.sub main :main
.include 'test_more.pir'
- plan(64)
+ plan(66)
create_namespace_pmc()
verify_namespace_type()
@@ -254,6 +254,28 @@
end_test8:
pop_eh
+ test9:
+ push_eh eh9
+ $P0 = get_global [ unicode:"\x{20AC}uros" ], "baz"
+ $S0 = $P0()
+ is($S0, unicode:"\x{20AC}uros", "Found sub in Unicode NameSpace")
+ goto end_test9
+ eh9:
+ ok(0, "Cannot find sub in Unicode NameSpace")
+ end_test9:
+ pop_eh
+
+ test10:
+ push_eh eh10
+ $P0 = get_global [ "Foo";unicode:"\x{20AC}uros" ], "baz"
+ $S0 = $P0()
+ is($S0, unicode:"Foo::\x{20AC}uros", "Found sub in nested Unicode NameSpace")
+ goto end_test10
+ eh10:
+ ok(0, "Cannot find sub in nested Unicode NameSpace")
+ end_test10:
+ pop_eh
+
.end
.sub 'get_sub_from_namespace_hash'
@@ -529,34 +551,49 @@
##### TEST NAMESPACES AND FUNCTIONS #####
# These functions and namespaces are used for the tests above
+# The current namespace
.namespace []
-
.sub 'baz'
.return("")
.end
+# NameSpace "Foo"
.namespace ["Foo"]
.sub 'baz'
.return("Foo")
.end
+# NameSpace "Foo";"Bar". Nested namespace
.namespace ["Foo";"Bar"]
.sub 'baz'
.return("Foo::Bar")
.end
+# Namespace specified in ISO-8859-1
.namespace [ iso-8859-1:"Fran\x{E7}ois" ]
.sub 'baz'
.return(iso-8859-1:"Fran\x{E7}ois")
.end
+# Nested namespace specified in ISO-8859
.namespace [ "Foo"; iso-8859-1:"Fran\x{E7}ois" ]
.sub 'baz'
.return(iso-8859-1:"Foo::Fran\x{E7}ois")
.end
-.HLL "MyHLL"
+# Namesace specified in Unicode
+.namespace [ unicode:"\x{20AC}uros" ]
+.sub 'baz'
+ .return(unicode:"\x{20AC}uros")
+.end
+# Nested namespace specified in Unicode
+.namespace [ "Foo";unicode:"\x{20AC}uros" ]
+.sub 'baz'
+ .return(unicode:"Foo::\x{20AC}uros")
+.end
+
+.HLL "MyHLL"
.sub 'baz'
.return("MyHLL")
.end
More information about the parrot-commits
mailing list