Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add substr tests which will throw UTF-16 implementations which are ac…
…ting like UCS-2.
  • Loading branch information
colomon committed Jul 25, 2012
1 parent 24cc87a commit 42450a0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S32-str/substr.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 87;
plan 90;

# L<S32::Str/Str/=item substr>

Expand Down Expand Up @@ -64,6 +64,13 @@ plan 87;
is("שיעבוד כבר".substr(4, 4), "וד כ", ".substr on Hebrew text");
}

{ # codepoints greater than 0xFFFF
my $str = (0x10426, 0x10427).chrs;
is $str.codes, 2, "Sanity check string";
is substr($str, 0, 1), 0x10426.chr, "Taking first char of Deseret string";
is substr($str, 1, 1), 0x10427.chr, "Taking second char of Deseret string";
}

sub l (Int $a) { my $l = $a; return $l }

#Substr with StrLen
Expand Down

0 comments on commit 42450a0

Please sign in to comment.