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

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

renamed tests

  • 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 => 18 }
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 # Test 2 non-zero rows
22 push @utf16, "\x4E\x00\x75\x6A\x4E\x0A\x4E\xBA\x75\x1F"; # "ichiban ue jinsei"
23
24 push @race, 'bq--aewrcsy';
25 push @race, 'bq--aew77ycl';
26 push @race, 'bq--3aas2abaetjq';
27 push @race, 'bq--ah7wi7x7te';
28 push @race, 'bq--abaquyq';
29 push @race, 'bq--aqrbacqq';
30 push @race, 'bq--bixuckb7';
31 push @race, 'bq--bikquja';
32 push @race, 'bq--3bhaa5lkjyfe5otvd4';
33
34 for my $i (0..$#utf16) {
35     ok(to_race($utf16[$i]), $race[$i]);
36     ok(from_race($race[$i]), $utf16[$i]);
37 }
Note: See TracBrowser for help on using the browser.