Browse files

Test passing string with unicode and nulls to/and from perl5.

  • Loading branch information...
pmurias committed Jan 16, 2012
1 parent 3a0067e commit 077c38449006b46579959da76f99af2d625c09e8
Showing with 17 additions and 0 deletions.
  1. +17 −0 S01-perl-5-integration/strings.t
@@ -0,0 +1,17 @@
+use Test;
+plan 6;
+is(eval("'Yet Another Perl Hacker'",:lang<perl5>),"Yet Another Perl Hacker");
+is(eval('"Yet Ano\0ther P\0erl Hacker"',:lang<perl5>),"Yet Ano\0ther P\0erl Hacker","Null Bytes in the middle of a converted string");
+is(eval('use utf8;"ąęóśćż"',:lang<perl5>),"ąęóśćż","utf8 in literals");
+my &test1 := eval('sub {$_[0] eq "Yet Another Perl Hacker"}',:lang<perl5>);
+my &test2 := eval('sub {$_[0] eq "Yet Ano\0ther P\0erl Hacker"}',:lang<perl5>);
+my &test3 := eval('sub {$_[0] eq "\x{105}\x{119}\x{f3}\x{15b}\x{107}\x{17c}"}',:lang<perl5>);
+ok(test1("Yet Another Perl Hacker"),"Passing simple strings to p5 land");
+ok(test2("Yet Ano\0ther P\0erl Hacker"),"Passing strings with null bytes to p5 land");
+ok(test3("ąęóśćż"),"Passing strings with unicode to p5 land");

0 comments on commit 077c384

Please sign in to comment.