Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added character set tests
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| use v6; | ||
|
|
||
| use Test; | ||
|
|
||
| =begin pod | ||
| tests over character sets. currently limited to ascii. | ||
| =end pod | ||
|
|
||
| # L<S05/Extensible metasyntax (C<< <...> >>)/"The special named assertions include"> | ||
|
|
||
| plan 11; | ||
|
|
||
| #?niecza skip 'Tests not completing under niecza' | ||
| { | ||
| my $ascii-chars = [~] chr(0)..chr(0xFF); | ||
|
|
||
| is $ascii-chars.comb(/<ident>/).join(" "), "ABCDEFGHIJKLMNOPQRSTUVWXYZ _ abcdefghijklmnopqrstuvwxyz ª µ º ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö øùúûüýþÿ", 'ident chars'; | ||
|
|
||
| is $ascii-chars.comb(/<alpha>/).join, "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ", 'alpha chars'; | ||
|
|
||
| is $ascii-chars.comb(/<space>/)>>.ord.join(","), ([~] (9..13,32,133,160).flat.join(",")), 'cntrl chars'; | ||
| is $ascii-chars.comb(/<digit>/).join, "0123456789", 'digit chars'; | ||
|
|
||
| is $ascii-chars.comb(/<alnum>/).join, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzªµºÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ", 'alnum chars'; | ||
|
|
||
| #?rakudo.parrot todo 'blank characters' | ||
| is $ascii-chars.comb(/<blank>/)>>.ord.join(","), ([~] (9,32,160).join(",")), 'blank chars'; | ||
|
|
||
| is $ascii-chars.comb(/<cntrl>/)>>.ord.join(","), ([~] (0..31, 127..159).join(",")), 'cntrl chars'; | ||
|
|
||
| #?rakudo.parrot todo 'lower characters' | ||
| is $ascii-chars.comb(/<lower>/).join, "abcdefghijklmnopqrstuvwxyzªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ", 'lower chars'; | ||
|
|
||
| #?rakudo.parrot todo 'punct characters' | ||
| is $ascii-chars.comb(/<punct>/).join, q<!"#%&'()*,-./:;?@[\]_{}¡«·»¿>, 'punct chars'; | ||
|
|
||
| is $ascii-chars.comb(/<upper>/).join, "ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ", 'upper chars'; | ||
|
|
||
| is $ascii-chars.comb(/<xdigit>/).join, "0123456789ABCDEFabcdef", 'xdigit chars'; | ||
|
|
||
| } |