/[jsFind]/trunk/t/06base_x.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/t/06base_x.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 36 - (show annotations)
Sat Oct 30 20:50:39 2004 UTC (19 years, 7 months ago) by dpavlin
File MIME type: application/x-troff
File size: 575 byte(s)
remove all capital letters from base62 encoding which made it base 36 I
guess. They are not supported under Windows (because filesystem is case
preserving, you can burn files with capital and lower letters, but browser
will read wrong one)

1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 1298;
7 use blib;
8 use jsFind;
9
10 BEGIN { use_ok('jsFind'); }
11
12 my @base_x = qw(
13 0 1 2 3 4 5 6 7 8 9
14 a b c d e f g h i j k l m n o p q r s t u v w x y z
15 );
16
17 my @nr;
18
19 diag "generating test base_x numbers";
20
21 foreach my $l (@base_x) {
22 foreach my $r (@base_x) {
23 if ($l eq '0') {
24 push @nr, $r;
25 } else {
26 push @nr, $l.$r;
27 }
28 }
29 }
30
31 cmp_ok(scalar @nr, '==', 1296, "generated ".@nr." numbers");
32
33 my $i = 0;
34 foreach my $nr (@nr) {
35 cmp_ok($nr, 'eq', jsFind::Node::base_x(undef,$i),"base_x($i) == $nr");
36 $i++;
37 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26