Permalink
Browse files

[t/spec] Refactored some literal/unicode tests under S02/S29

git-svn-id: http://svn.pugscode.org/pugs@20236 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent d4b5038 commit bb281e2b04e9465b871c11eb2660cbea8dad5d9c cosimo committed Apr 5, 2008
Showing with 23 additions and 1 deletion.
  1. +21 −0 S02-literals/hex_chars.t
  2. +2 −1 S29-str/length.t
View
@@ -0,0 +1,21 @@
+use v6;
+use Test;
+
+plan 4;
+
+#L<S02/Literals/"Characters indexed by hex numbers">
+my %unicode = (
+ 'a' => "\x61",
+ 'æ' => "\xE6",
+ '' => "\x5583",
+ '𨮁' => "\x28B81",
+);
+
+for %unicode.kv -> $literal, $codepoint {
+ is(
+ $codepoint,
+ $literal,
+ 'Does a character codepoint (\x..) evaluate to the same thing as its literal?'
+ );
+}
+
View
@@ -15,7 +15,7 @@ L<"http://www.unicode.org/unicode/reports/tr11/">
=end pod
-plan 54;
+plan 55;
eval_dies_ok('"moose".length', 'Str.length properly not implemented');
@@ -45,6 +45,7 @@ my @data = (
# string octets codepoints grapheme chars
"", 0, 0, 0, 0,
"moose", 5, 5, 5, 5,
+ "møøse", 7, 5, 5, 5,
"C:\\Program Files", 16, 16, 16, 16,
~@stringy, 8, 8, 8, 8,
"\x020ac \\x020ac", 11, 9, 9, 9,

0 comments on commit bb281e2

Please sign in to comment.