root/Convert-RACE/trunk/t/02race.t

Revision 41 (checked in by miyagawa, 19 years ago)

applied the patch from Philip.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2 use Test;
3 BEGIN { plan tests => 16 }
4
5 use Convert::RACE qw(to_race from_race);
6
7 my(@utf16, @race);
8
9 push @utf16, "\x01\x2D\x01\x11\x01\x4B";
10 push @utf16, "\x01\x2D\x00\xe0\x01\x4B";
11 push @utf16, "\x01\x2D\x00\x20\x24\xd3";
12 push @utf16, "\x00\x64\x01\x7e\x01\xff";
13 # Test \x0A as low byte with \x00 as high byte
14 push @utf16, "\x00\x41\x00\x0A\x00\x62"; # "A\nb"
15 # Test \x0A as low byte with something als as high byte
16 push @utf16, "\x04\x22\x04\x10\x04\x0A\x04\x10"; # "TANYA" in Serbian
17 # Test \x0A as high byte
18 push @utf16, "\x0A\x2F\x0A\x41\x0A\x28\x0A\x3F"; # Gurmukhi "yuni"?
19 # Test \x0A as both high and low byte
20 push @utf16, "\x0A\x15\x0A\x0A\x0A\x24"; # Gurmukhi "kauuta"?
21
22 push @race, 'bq--aewrcsy';
23 push @race, 'bq--aew77ycl';
24 push @race, 'bq--3aas2abaetjq';
25 push @race, 'bq--ah7wi7x7te';
26 push @race, 'bq--abaquyq';
27 push @race, 'bq--aqrbacqq';
28 push @race, 'bq--bixuckb7';
29 push @race, 'bq--bikquja';
30
31 for my $i (0..$#utf16) {
32     ok(to_race($utf16[$i]), $race[$i]);
33     ok(from_race($race[$i]), $utf16[$i]);
34 }
Note: See TracBrowser for help on using the browser.