Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #66 from alexghacker/master
Create tests for the COMBINING GRAPHEME JOINER special case
  • Loading branch information
zoffixznet committed Aug 28, 2015
2 parents 66de147 + 79585f0 commit 8bb05dc
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions S15-nfg/cgj.t
@@ -0,0 +1,41 @@
# for background, see http://irclog.perlgeek.de/perl6/2015-06-08#i_10716770 through 16:44 UTC

# non-normative references:
# http://unicode.org/faq/char_combmark.html#14
# http://unicode.org/faq/char_combmark.html#15
# http://unicode.org/faq/char_combmark.html#16
# http://unicode.org/faq/char_combmark.html#17
# http://unicode.org/faq/char_combmark.html#18

# normative reference
# http://www.unicode.org/versions/Unicode7.0.0/ch23.pdf (pages numbered 805-807)

use Test;

plan 8;

my $control-str = 'o';

is $control-str.chars, 1, "Correct value of .chars for '$control-str' (no combining characters)";

my @non-cgj-combiners = (
"o\c[COMBINING DOT ABOVE]",
"o\c[COMBINING DOT BELOW]",
"o\c[COMBINING DOT ABOVE]\c[COMBINING DOT BELOW]",
);

for @non-cgj-combiners -> $test-str {
is $test-str.chars, 1, "Correct value of .chars for '$test-str' (combining characters, but not CGJ)";
}

my @cgj-first-combiner = (
"o\c[COMBINING GRAPHEME JOINER]",
"o\c[COMBINING DOT ABOVE]\c[COMBINING GRAPHEME JOINER]",
"o\c[COMBINING GRAPHEME JOINER]\c[COMBINING DOT BELOW]",
"o\c[COMBINING DOT ABOVE]\c[COMBINING GRAPHEME JOINER]\c[COMBINING DOT BELOW]",
);

for @cgj-first-combiner -> $test-str {
#?rakudo todo 'CGJ special case of combining character with ccc=0'
is $test-str.chars, 1, "Correct value of .chars for '$test-str' (combining characters, including CGJ)";
}

0 comments on commit 8bb05dc

Please sign in to comment.