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

Revision 37 (checked in by miyagawa, 20 years ago)

fixed the bug in case of all of the upper octets are either 0x00 or one single other value.

  • 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 => 8 }
4
5 use Convert::RACE qw(to_race from_race);
6
7 my $i1 = "\x01\x2D\x01\x11\x01\x4B";
8 my $i2 = "\x01\x2D\x00\xe0\x01\x4B";
9 my $i3 = "\x01\x2D\x00\x20\x24\xd3";
10 my $i4 = "\x00\x64\x01\x7e\x01\xff";
11
12 my $r1 = 'bq--aewrcsy';
13 my $r2 = 'bq--aew77ycl';
14 my $r3 = 'bq--3aas2abaetjq';
15 my $r4 = 'bq--ah7wi7x7te';
16
17 ok(to_race($i1),$r1);
18 ok(to_race($i2),$r2);
19 ok(to_race($i3),$r3);
20 ok(to_race($i4),$r4);
21
22 ok(from_race($r1),$i1);
23 ok(from_race($r2),$i2);
24 ok(from_race($r3),$i3);
25 ok(from_race($r4),$i4);
Note: See TracBrowser for help on using the browser.