This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fwd: CPAN Upload: J/JP/JPEACOCK/version-0.70.tar.gz
[perl5.git] / lib / version.t
CommitLineData
129318bd 1#! /usr/local/perl -w
a7ad731c
HS
2# Before `make install' is performed this script should be runnable with
3# `make test'. After `make install' it should work as `perl test.pl'
a7ad731c
HS
4
5#########################
6
34ba6322 7use Test::More qw(no_plan);
c8a14fb6
RGS
8require Test::Harness;
9no warnings 'once';
10*Verbose = \$Test::Harness::Verbose;
a7ad731c 11
137d6fc0 12diag "Tests with base class" unless $ENV{PERL_CORE};
a7ad731c 13
5eb567df 14BEGIN {
43eaf59d 15 use_ok("version", 0.50); # If we made it this far, we are ok.
5eb567df
RGS
16}
17
137d6fc0
JP
18BaseTests("version");
19
20diag "Tests with empty derived class" unless $ENV{PERL_CORE};
21
22package version::Empty;
43eaf59d 23use base version;
137d6fc0 24$VERSION = 0.01;
43eaf59d
SP
25no warnings 'redefine';
26*::qv = sub { return bless version::qv(shift), __PACKAGE__; };
137d6fc0 27
e0218a61
JP
28package version::Bad;
29use base version;
30sub new { my($self,$n)=@_; bless \$n, $self }
31
137d6fc0 32package main;
e0218a61 33my $testobj = version::Empty->new(1.002_003);
137d6fc0
JP
34isa_ok( $testobj, "version::Empty" );
35ok( $testobj->numify == 1.002003, "Numified correctly" );
9137345a
JP
36ok( $testobj->stringify eq "1.002003", "Stringified correctly" );
37ok( $testobj->normal eq "v1.2.3", "Normalified correctly" );
137d6fc0 38
e0218a61 39my $verobj = version->new("1.2.4");
137d6fc0
JP
40ok( $verobj > $testobj, "Comparison vs parent class" );
41ok( $verobj gt $testobj, "Comparison vs parent class" );
42BaseTests("version::Empty");
43
e0218a61
JP
44diag "tests with bad subclass" unless $ENV{PERL_CORE};
45$testobj = version::Bad->new(1.002_003);
46isa_ok( $testobj, "version::Bad" );
47eval { my $string = $testobj->numify };
48like($@, qr/Invalid version object/,
49 "Bad subclass numify");
50eval { my $string = $testobj->normal };
51like($@, qr/Invalid version object/,
52 "Bad subclass normal");
53eval { my $string = $testobj->stringify };
54like($@, qr/Invalid version object/,
55 "Bad subclass stringify");
56eval { my $test = $testobj > 1.0 };
57like($@, qr/Invalid version object/,
58 "Bad subclass vcmp");
59
c0b17f21
JP
60# dummy up a redundant call to satify David Wheeler
61local $SIG{__WARN__} = sub { die $_[0] };
62eval 'use version;';
63unlike ($@, qr/^Subroutine main::qv redefined/,
64 "Only export qv once per package (to prevent redefined warnings).");
65
137d6fc0
JP
66sub BaseTests {
67
317f7c8a
RGS
68 my ($CLASS, $no_qv) = @_;
69
70 # Insert your test code below, the Test module is use()ed here so read
71 # its man page ( perldoc Test ) for help writing this test script.
72
73 # Test bare number processing
74 diag "tests with bare numbers" if $Verbose;
75 $version = $CLASS->new(5.005_03);
76 is ( "$version" , "5.005030" , '5.005_03 eq 5.5.30' );
77 $version = $CLASS->new(1.23);
78 is ( "$version" , "1.230" , '1.23 eq "1.230"' );
79
80 # Test quoted number processing
81 diag "tests with quoted numbers" if $Verbose;
82 $version = $CLASS->new("5.005_03");
83 is ( "$version" , "5.005_030" , '"5.005_03" eq "5.005_030"' );
84 $version = $CLASS->new("v1.23");
85 is ( "$version" , "v1.23.0" , '"v1.23" eq "v1.23.0"' );
86
87 # Test stringify operator
88 diag "tests with stringify" if $Verbose;
89 $version = $CLASS->new("5.005");
90 is ( "$version" , "5.005" , '5.005 eq "5.005"' );
91 $version = $CLASS->new("5.006.001");
92 is ( "$version" , "v5.6.1" , '5.006.001 eq v5.6.1' );
93 $version = $CLASS->new("1.2.3_4");
94 is ( "$version" , "v1.2.3_4" , 'alpha version 1.2.3_4 eq v1.2.3_4' );
95
96 # test illegal formats
97 diag "test illegal formats" if $Verbose;
98 eval {my $version = $CLASS->new("1.2_3_4")};
99 like($@, qr/multiple underscores/,
100 "Invalid version format (multiple underscores)");
101
102 eval {my $version = $CLASS->new("1.2_3.4")};
103 like($@, qr/underscores before decimal/,
104 "Invalid version format (underscores before decimal)");
105
106 eval {my $version = $CLASS->new("1_2")};
107 like($@, qr/alpha without decimal/,
108 "Invalid version format (alpha without decimal)");
109
110 # for this first test, just upgrade the warn() to die()
111 eval {
112 local $SIG{__WARN__} = sub { die $_[0] };
113 $version = $CLASS->new("1.2b3");
114 };
115 my $warnregex = "Version string '.+' contains invalid data; ".
116 "ignoring: '.+'";
117
118 like($@, qr/$warnregex/,
119 "Version string contains invalid data; ignoring");
120
121 # from here on out capture the warning and test independently
f34c6aaf 122 {
317f7c8a
RGS
123 my $warning;
124 local $SIG{__WARN__} = sub { $warning = $_[0] };
125 $version = $CLASS->new("99 and 44/100 pure");
126
127 like($warning, qr/$warnregex/,
128 "Version string contains invalid data; ignoring");
129 ok ("$version" eq "99.000", '$version eq "99.000"');
130 ok ($version->numify == 99.0, '$version->numify == 99.0');
131 ok ($version->normal eq "v99.0.0", '$version->normal eq v99.0.0');
132
133 $version = $CLASS->new("something");
134 like($warning, qr/$warnregex/,
135 "Version string contains invalid data; ignoring");
136 ok (defined $version, 'defined $version');
137
138 # reset the test object to something reasonable
139 $version = $CLASS->new("1.2.3");
140
141 # Test boolean operator
142 ok ($version, 'boolean');
143
144 # Test class membership
145 isa_ok ( $version, $CLASS );
146
147 # Test comparison operators with self
148 diag "tests with self" if $Verbose;
149 ok ( $version eq $version, '$version eq $version' );
150 is ( $version cmp $version, 0, '$version cmp $version == 0' );
151 ok ( $version == $version, '$version == $version' );
152
153 # test first with non-object
154 $version = $CLASS->new("5.006.001");
155 $new_version = "5.8.0";
156 diag "tests with non-objects" if $Verbose;
157 ok ( $version ne $new_version, '$version ne $new_version' );
158 ok ( $version lt $new_version, '$version lt $new_version' );
159 ok ( $new_version gt $version, '$new_version gt $version' );
160 ok ( ref(\$new_version) eq 'SCALAR', 'no auto-upgrade');
161 $new_version = "$version";
162 ok ( $version eq $new_version, '$version eq $new_version' );
163 ok ( $new_version eq $version, '$new_version eq $version' );
164
165 # now test with existing object
166 $new_version = $CLASS->new("5.8.0");
167 diag "tests with objects" if $Verbose;
168 ok ( $version ne $new_version, '$version ne $new_version' );
169 ok ( $version lt $new_version, '$version lt $new_version' );
170 ok ( $new_version gt $version, '$new_version gt $version' );
171 $new_version = $CLASS->new("$version");
172 ok ( $version eq $new_version, '$version eq $new_version' );
173
174 # Test Numeric Comparison operators
175 # test first with non-object
176 $new_version = "5.8.0";
177 diag "numeric tests with non-objects" if $Verbose;
178 ok ( $version == $version, '$version == $version' );
179 ok ( $version < $new_version, '$version < $new_version' );
180 ok ( $new_version > $version, '$new_version > $version' );
181 ok ( $version != $new_version, '$version != $new_version' );
182
183 # now test with existing object
184 $new_version = $CLASS->new($new_version);
185 diag "numeric tests with objects" if $Verbose;
186 ok ( $version < $new_version, '$version < $new_version' );
187 ok ( $new_version > $version, '$new_version > $version' );
188 ok ( $version != $new_version, '$version != $new_version' );
189
190 # now test with actual numbers
191 diag "numeric tests with numbers" if $Verbose;
192 ok ( $version->numify() == 5.006001, '$version->numify() == 5.006001' );
193 ok ( $version->numify() <= 5.006001, '$version->numify() <= 5.006001' );
194 ok ( $version->numify() < 5.008, '$version->numify() < 5.008' );
195 #ok ( $version->numify() > v5.005_02, '$version->numify() > 5.005_02' );
196
197 # test with long decimals
198 diag "Tests with extended decimal versions" if $Verbose;
199 $version = $CLASS->new(1.002003);
200 ok ( $version eq "1.2.3", '$version eq "1.2.3"');
201 ok ( $version->numify == 1.002003, '$version->numify == 1.002003');
202 $version = $CLASS->new("2002.09.30.1");
203 ok ( $version eq "2002.9.30.1",'$version eq 2002.9.30.1');
204 ok ( $version->numify == 2002.009030001,
205 '$version->numify == 2002.009030001');
206
207 # now test with alpha version form with string
208 $version = $CLASS->new("1.2.3");
209 $new_version = "1.2.3_4";
210 diag "tests with alpha-style non-objects" if $Verbose;
211 ok ( $version lt $new_version, '$version lt $new_version' );
212 ok ( $new_version gt $version, '$new_version gt $version' );
213 ok ( $version ne $new_version, '$version ne $new_version' );
214
215 $version = $CLASS->new("1.2.4");
216 diag "numeric tests with alpha-style non-objects"
217 if $Verbose;
218 ok ( $version > $new_version, '$version > $new_version' );
219 ok ( $new_version < $version, '$new_version < $version' );
220 ok ( $version != $new_version, '$version != $new_version' );
221
222 # now test with alpha version form with object
223 $version = $CLASS->new("1.2.3");
224 $new_version = $CLASS->new("1.2.3_4");
225 diag "tests with alpha-style objects" if $Verbose;
226 ok ( $version < $new_version, '$version < $new_version' );
227 ok ( $new_version > $version, '$new_version > $version' );
228 ok ( $version != $new_version, '$version != $new_version' );
229 ok ( !$version->is_alpha, '!$version->is_alpha');
230 ok ( $new_version->is_alpha, '$new_version->is_alpha');
231
232 $version = $CLASS->new("1.2.4");
233 diag "tests with alpha-style objects" if $Verbose;
234 ok ( $version > $new_version, '$version > $new_version' );
235 ok ( $new_version < $version, '$new_version < $version' );
236 ok ( $version != $new_version, '$version != $new_version' );
237
238 $version = $CLASS->new("1.2.3.4");
239 $new_version = $CLASS->new("1.2.3_4");
240 diag "tests with alpha-style objects with same subversion"
241 if $Verbose;
242 ok ( $version > $new_version, '$version > $new_version' );
243 ok ( $new_version < $version, '$new_version < $version' );
244 ok ( $version != $new_version, '$version != $new_version' );
245
246 diag "test implicit [in]equality" if $Verbose;
247 $version = $CLASS->new("v1.2.3");
248 $new_version = $CLASS->new("1.2.3.0");
249 ok ( $version == $new_version, '$version == $new_version' );
250 $new_version = $CLASS->new("1.2.3_0");
251 ok ( $version == $new_version, '$version == $new_version' );
252 $new_version = $CLASS->new("1.2.3.1");
253 ok ( $version < $new_version, '$version < $new_version' );
254 $new_version = $CLASS->new("1.2.3_1");
255 ok ( $version < $new_version, '$version < $new_version' );
256 $new_version = $CLASS->new("1.1.999");
257 ok ( $version > $new_version, '$version > $new_version' );
258
259 # that which is not expressly permitted is forbidden
260 diag "forbidden operations" if $Verbose;
261 ok ( !eval { ++$version }, "noop ++" );
262 ok ( !eval { --$version }, "noop --" );
263 ok ( !eval { $version/1 }, "noop /" );
264 ok ( !eval { $version*3 }, "noop *" );
265 ok ( !eval { abs($version) }, "noop abs" );
137d6fc0 266
c8a14fb6 267SKIP: {
317f7c8a
RGS
268 skip "version require'd instead of use'd, cannot test qv", 3
269 if defined $no_qv;
270 # test the qv() sub
271 diag "testing qv" if $Verbose;
272 $version = qv("1.2");
273 cmp_ok ( $version, "eq", "v1.2.0", 'qv("1.2") eq "1.2.0"' );
274 $version = qv(1.2);
275 cmp_ok ( $version, "eq", "v1.2.0", 'qv(1.2) eq "1.2.0"' );
276 isa_ok( qv('5.008'), $CLASS );
c8a14fb6 277}
137d6fc0 278
317f7c8a
RGS
279 # test creation from existing version object
280 diag "create new from existing version" if $Verbose;
281 ok (eval {$new_version = $CLASS->new($version)},
282 "new from existing object");
283 ok ($new_version == $version, "class->new($version) identical");
284 $new_version = $version->new();
285 isa_ok ($new_version, $CLASS );
286 is ($new_version, "0.000", "version->new() doesn't clone");
287 $new_version = $version->new("1.2.3");
288 is ($new_version, "v1.2.3" , '$version->new("1.2.3") works too');
289
290 # test the CVS revision mode
291 diag "testing CVS Revision" if $Verbose;
292 $version = new $CLASS qw$Revision: 1.2$;
293 ok ( $version eq "1.2.0", 'qw$Revision: 1.2$ eq 1.2.0' );
294 $version = new $CLASS qw$Revision: 1.2.3.4$;
295 ok ( $version eq "1.2.3.4", 'qw$Revision: 1.2.3.4$ eq 1.2.3.4' );
296
297 # test the CPAN style reduced significant digit form
298 diag "testing CPAN-style versions" if $Verbose;
299 $version = $CLASS->new("1.23_01");
300 is ( "$version" , "1.23_0100", "CPAN-style alpha version" );
301 ok ( $version > 1.23, "1.23_01 > 1.23");
302 ok ( $version < 1.24, "1.23_01 < 1.24");
303
304 # test reformed UNIVERSAL::VERSION
305 diag "Replacement UNIVERSAL::VERSION tests" if $Verbose;
f34c6aaf
JP
306
307 my $error_regex = $] < 5.006
308 ? 'version \d required'
309 : 'does not define \$...::VERSION';
317f7c8a 310
f34c6aaf
JP
311 {
312 open F, ">aaa.pm" or die "Cannot open aaa.pm: $!\n";
313 print F "package aaa;\n\$aaa::VERSION=0.58;\n1;\n";
314 close F;
315
316 $version = 0.58; $version = sprintf("%.3f",$version);
317 eval "use lib '.'; use aaa $version";
318 unlike($@, qr/aaa version $version/,
319 'Replacement eval works with exact version');
320
321 # test as class method
322 $new_version = "aaa"->VERSION;
323 cmp_ok($new_version,'eq',$version, "Called as class method");
8dd04980 324
f34c6aaf
JP
325 eval "print Completely::Unknown::Module->VERSION";
326 if ( $] < 5.008 ) {
327 unlike($@, qr/$error_regex/,
328 "Don't freak if the module doesn't even exist");
329 }
330 else {
331 unlike($@, qr/defines neither package nor VERSION/,
332 "Don't freak if the module doesn't even exist");
333 }
334
335 # this should fail even with old UNIVERSAL::VERSION
336 $version += 0.01; $version = sprintf("%.3f",$version);
337 eval "use lib '.'; use aaa $version";
338 like($@, qr/aaa version $version/,
339 'Replacement eval works with incremented version');
340
341 $version =~ s/0+$//; #convert to string and remove trailing 0's
342 chop($version); # shorten by 1 digit, should still succeed
343 eval "use lib '.'; use aaa $version";
344 unlike($@, qr/aaa version $version/,
345 'Replacement eval works with single digit');
346
347 # this would fail with old UNIVERSAL::VERSION
348 $version += 0.1; $version = sprintf("%.3f",$version);
349 eval "use lib '.'; use aaa $version";
350 like($@, qr/aaa version $version/,
351 'Replacement eval works with incremented digit');
352 unlink 'aaa.pm';
353 }
317f7c8a
RGS
354
355 { # dummy up some variously broken modules for testing
356 open F, ">xxx.pm" or die "Cannot open xxx.pm: $!\n";
357 print F "1;\n";
358 close F;
f34c6aaf
JP
359
360 eval "use lib '.'; use xxx 3;";
317f7c8a 361 if ( $] < 5.008 ) {
f34c6aaf
JP
362 like($@, qr/$error_regex/,
363 'Replacement handles modules without package or VERSION');
c8a14fb6 364 }
317f7c8a 365 else {
f34c6aaf
JP
366 like($@, qr/defines neither package nor VERSION/,
367 'Replacement handles modules without package or VERSION');
c8a14fb6 368 }
f34c6aaf 369 eval "use lib '.'; use xxx; \$version = xxx->VERSION";
317f7c8a
RGS
370 unlike ($@, qr/$error_regex/,
371 'Replacement handles modules without package or VERSION');
f34c6aaf 372 ok (!defined($version), "Called as class method");
317f7c8a
RGS
373 unlink 'xxx.pm';
374 }
375
376 { # dummy up some variously broken modules for testing
377 open F, ">yyy.pm" or die "Cannot open yyy.pm: $!\n";
378 print F "package yyy;\n#look ma no VERSION\n1;\n";
379 close F;
380 eval "use lib '.'; use yyy 3;";
f34c6aaf 381 like ($@, qr/$error_regex/,
317f7c8a
RGS
382 'Replacement handles modules without VERSION');
383 eval "use lib '.'; use yyy; print yyy->VERSION";
f34c6aaf 384 unlike ($@, qr/$error_regex/,
317f7c8a
RGS
385 'Replacement handles modules without VERSION');
386 unlink 'yyy.pm';
387 }
388
389 { # dummy up some variously broken modules for testing
390 open F, ">zzz.pm" or die "Cannot open zzz.pm: $!\n";
391 print F "package zzz;\n\@VERSION = ();\n1;\n";
392 close F;
393 eval "use lib '.'; use zzz 3;";
f34c6aaf 394 like ($@, qr/$error_regex/,
317f7c8a
RGS
395 'Replacement handles modules without VERSION');
396 eval "use lib '.'; use zzz; print zzz->VERSION";
f34c6aaf 397 unlike ($@, qr/$error_regex/,
317f7c8a
RGS
398 'Replacement handles modules without VERSION');
399 unlink 'zzz.pm';
400 }
401
137d6fc0 402SKIP: {
317f7c8a
RGS
403 skip 'Cannot test bare v-strings with Perl < 5.8.1', 4
404 if $] < 5.008_001;
405 diag "Tests with v-strings" if $Verbose;
406 $version = $CLASS->new(1.2.3);
407 ok("$version" eq "v1.2.3", '"$version" eq 1.2.3');
408 $version = $CLASS->new(1.0.0);
409 $new_version = $CLASS->new(1);
410 ok($version == $new_version, '$version == $new_version');
411 ok($version eq $new_version, '$version eq $new_version');
412 skip "version require'd instead of use'd, cannot test qv", 1
413 if defined $no_qv;
414 $version = qv(1.2.3);
415 ok("$version" eq "v1.2.3", 'v-string initialized qv()');
416 }
417
418 diag "Tests with real-world (malformed) data" if $Verbose;
419
420 # trailing zero testing (reported by Andreas Koenig).
421 $version = $CLASS->new("1");
422 ok($version->numify eq "1.000", "trailing zeros preserved");
423 $version = $CLASS->new("1.0");
424 ok($version->numify eq "1.000", "trailing zeros preserved");
425 $version = $CLASS->new("1.0.0");
426 ok($version->numify eq "1.000000", "trailing zeros preserved");
427 $version = $CLASS->new("1.0.0.0");
428 ok($version->numify eq "1.000000000", "trailing zeros preserved");
429
430 # leading zero testing (reported by Andreas Koenig).
431 $version = $CLASS->new(".7");
432 ok($version->numify eq "0.700", "leading zero inferred");
433
434 # leading space testing (reported by Andreas Koenig).
435 $version = $CLASS->new(" 1.7");
436 ok($version->numify eq "1.700", "leading space ignored");
437
438 # RT 19517 - deal with undef and 'undef' initialization
439 ok($version ne 'undef', "Undef version comparison #1");
440 ok($version ne undef, "Undef version comparison #2");
441 $version = $CLASS->new('undef');
442 unlike($warning, qr/^Version string 'undef' contains invalid data/,
443 "Version string 'undef'");
444
445 $version = $CLASS->new(undef);
446 like($warning, qr/^Use of uninitialized value/,
447 "Version string 'undef'");
448 ok($version eq 'undef', "Undef version comparison #3");
449 ok($version eq undef, "Undef version comparison #4");
450 eval "\$version = \$CLASS->new()"; # no parameter at all
451 unlike($@, qr/^Bizarre copy of CODE/, "No initializer at all");
452 ok($version eq 'undef', "Undef version comparison #5");
453 ok($version eq undef, "Undef version comparison #6");
454
455 $version = $CLASS->new(0.000001);
456 unlike($warning, qr/^Version string '1e-06' contains invalid data/,
457 "Very small version objects");
f34c6aaf 458 }
e0218a61 459
317f7c8a
RGS
460SKIP: {
461 # dummy up a legal module for testing RT#19017
462 open F, ">www.pm" or die "Cannot open www.pm: $!\n";
463 print F <<"EOF";
c8a14fb6
RGS
464package www;
465use version; \$VERSION = qv('0.0.4');
4661;
467EOF
317f7c8a
RGS
468 close F;
469
470 eval "use lib '.'; use www 0.000008;";
471 like ($@, qr/^www version 0.000008 \(v0.0.8\) required/,
472 "Make sure very small versions don't freak");
473 eval "use lib '.'; use www 1;";
474 like ($@, qr/^www version 1.000 \(v1.0.0\) required/,
475 "Comparing vs. version with no decimal");
476 eval "use lib '.'; use www 1.;";
477 like ($@, qr/^www version 1.000 \(v1.0.0\) required/,
478 "Comparing vs. version with decimal only");
479
d69f6151
JP
480 if ( $] < 5.006_002 ) {
481 unlink 'www.pm';
482 skip 'Cannot "use" extended versions with Perl < 5.6.2', 3;
483 }
317f7c8a
RGS
484 eval "use lib '.'; use www 0.0.8;";
485 like ($@, qr/^www version 0.000008 \(v0.0.8\) required/,
486 "Make sure very small versions don't freak");
487
488 eval "use lib '.'; use www 0.0.4;";
489 unlike($@, qr/^www version 0.000004 \(v0.0.4\) required/,
490 'Succeed - required == VERSION');
491 cmp_ok ( "www"->VERSION, 'eq', '0.000004', 'No undef warnings' );
492
493 unlink 'www.pm';
494 }
495
496 open F, ">vvv.pm" or die "Cannot open vvv.pm: $!\n";
497 print F <<"EOF";
92dcf8ce
JP
498package vvv;
499use base qw(version);
5001;
501EOF
317f7c8a
RGS
502 close F;
503 # need to eliminate any other qv()'s
504 undef *main::qv;
505 ok(!defined(&{"main\::qv"}), "make sure we cleared qv() properly");
506 eval "use lib '.'; use vvv;";
507 ok(defined(&{"main\::qv"}), "make sure we exported qv() properly");
508 isa_ok( qv(1.2), "vvv");
509 unlink 'vvv.pm';
d69f6151
JP
510
511SKIP: {
512 # test locale handling
f34c6aaf
JP
513 my $warning;
514 local $SIG{__WARN__} = sub { $warning = $_[0] };
d69f6151
JP
515 my $ver = 1.23; # has to be floating point number
516 my $loc;
517 while (<DATA>) {
518 chomp;
519 $loc = POSIX::setlocale( &POSIX::LC_ALL, $_);
520 last if POSIX::localeconv()->{decimal_point} eq ',';
521 }
522 skip 'Cannot test locale handling without a comma locale', 4
523 unless ( $loc and ($ver eq '1,23') );
524
525 diag ("Testing locale handling with $loc") if $Verbose;
526
527 my $v = $CLASS->new($ver);
528 unlike($warning,qr/Version string '1,23' contains invalid data/,
529 "Process locale-dependent floating point");
530 is ($v, "1.230", "Locale doesn't apply to version objects");
531 ok ($v == $ver, "Comparison to locale floating point");
532 }
f34c6aaf
JP
533
534 eval 'my $v = $CLASS->new("1._1");';
535 unlike($@, qr/^Invalid version format \(alpha with zero width\)/,
536 "Invalid version format 1._1");
137d6fc0 537}
cb5772bb
RGS
538
5391;
d69f6151
JP
540
541__DATA__
542af_ZA
543af_ZA.utf8
544an_ES
545an_ES.utf8
546az_AZ.utf8
547be_BY
548be_BY.utf8
549bg_BG
550bg_BG.utf8
551br_FR
552br_FR@euro
553br_FR.utf8
554bs_BA
555bs_BA.utf8
556ca_ES
557ca_ES@euro
558ca_ES.utf8
559cs_CZ
560cs_CZ.utf8
561da_DK
562da_DK.utf8
563de_AT
564de_AT@euro
565de_AT.utf8
566de_BE
567de_BE@euro
568de_BE.utf8
569de_DE
570de_DE@euro
571de_DE.utf8
572de_LU
573de_LU@euro
574de_LU.utf8
575el_GR
576el_GR.utf8
577en_DK
578en_DK.utf8
579es_AR
580es_AR.utf8
581es_BO
582es_BO.utf8
583es_CL
584es_CL.utf8
585es_CO
586es_CO.utf8
587es_EC
588es_EC.utf8
589es_ES
590es_ES@euro
591es_ES.utf8
592es_PY
593es_PY.utf8
594es_UY
595es_UY.utf8
596es_VE
597es_VE.utf8
598et_EE
599et_EE.iso885915
600et_EE.utf8
601eu_ES
602eu_ES@euro
603eu_ES.utf8
604fi_FI
605fi_FI@euro
606fi_FI.utf8
607fo_FO
608fo_FO.utf8
609fr_BE
610fr_BE@euro
611fr_BE.utf8
612fr_CA
613fr_CA.utf8
614fr_CH
615fr_CH.utf8
616fr_FR
617fr_FR@euro
618fr_FR.utf8
619fr_LU
620fr_LU@euro
621fr_LU.utf8
622gl_ES
623gl_ES@euro
624gl_ES.utf8
625hr_HR
626hr_HR.utf8
627hu_HU
628hu_HU.utf8
629id_ID
630id_ID.utf8
631is_IS
632is_IS.utf8
633it_CH
634it_CH.utf8
635it_IT
636it_IT@euro
637it_IT.utf8
638ka_GE
639ka_GE.utf8
640kk_KZ
641kk_KZ.utf8
642kl_GL
643kl_GL.utf8
644lt_LT
645lt_LT.utf8
646lv_LV
647lv_LV.utf8
648mk_MK
649mk_MK.utf8
650mn_MN
651mn_MN.utf8
652nb_NO
653nb_NO.utf8
654nl_BE
655nl_BE@euro
656nl_BE.utf8
657nl_NL
658nl_NL@euro
659nl_NL.utf8
660nn_NO
661nn_NO.utf8
662no_NO
663no_NO.utf8
664oc_FR
665oc_FR.utf8
666pl_PL
667pl_PL.utf8
668pt_BR
669pt_BR.utf8
670pt_PT
671pt_PT@euro
672pt_PT.utf8
673ro_RO
674ro_RO.utf8
675ru_RU
676ru_RU.koi8r
677ru_RU.utf8
678ru_UA
679ru_UA.utf8
680se_NO
681se_NO.utf8
682sh_YU
683sh_YU.utf8
684sk_SK
685sk_SK.utf8
686sl_SI
687sl_SI.utf8
688sq_AL
689sq_AL.utf8
690sr_CS
691sr_CS.utf8
692sv_FI
693sv_FI@euro
694sv_FI.utf8
695sv_SE
696sv_SE.iso885915
697sv_SE.utf8
698tg_TJ
699tg_TJ.utf8
700tr_TR
701tr_TR.utf8
702tt_RU.utf8
703uk_UA
704uk_UA.utf8
705vi_VN
706vi_VN.tcvn
707wa_BE
708wa_BE@euro
709wa_BE.utf8
710