Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test covering non-tiny Uni -> Str handling.
All the other tests so far for NFG look at just a handful of codes;
this covers dealing with longer strings and Uni buffers.
  • Loading branch information
jnthn committed Apr 24, 2015
1 parent f687502 commit f4f5735
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions S15-nfg/long-uni.t
@@ -0,0 +1,17 @@
use Test;

plan 24;

for (10, 100, 1000, 10000) -> $n {
my @codes = (0x0044, 0x0307, 0x0323) xx $n;

my $s = Uni.new(@codes).Str;
is $s.chars, $n, 'long Uni -> Str works out';

my $nfc = $s.NFC;
is $nfc.codes, 2 * $n, 'long Str -> NFC works out';
is $nfc[0], 0x1E0C, 'NFC buffer has correct first value';
is $nfc[1], 0x307, 'NFC buffer has correct second value';
is $nfc[* - 2], 0x1E0C, 'NFC buffer has correct second-to-last value';
is $nfc[* - 1], 0x307, 'NFC buffer has correct last value';
}

0 comments on commit f4f5735

Please sign in to comment.