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'
5 #########################
7 use Test::More qw(no_plan);
11 *Verbose = \$Test::Harness::Verbose;
12 use POSIX qw/locale_h/;
13 use File::Temp qw/tempfile/;
17 use_ok("version", 0.77);
18 # If we made it this far, we are ok.
23 diag "Tests with base class" unless $ENV{PERL_CORE};
25 BaseTests("version","new","qv");
26 BaseTests("version","new","declare");
27 BaseTests("version","parse", "qv");
28 BaseTests("version","parse", "declare");
30 # dummy up a redundant call to satify David Wheeler
31 local $SIG{__WARN__} = sub { die $_[0] };
33 unlike ($@, qr/^Subroutine main::declare redefined/,
34 "Only export declare once per package (to prevent redefined warnings).");
38 sub new { my($self,$n)=@_; bless \$n, $self }
43 local $SIG{__WARN__} = sub { $warning = $_[0] };
44 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
45 (my $package = basename($filename)) =~ s/\.pm$//;
47 # This is an empty subclass
56 delete $main::INC{'$package'};
57 undef &qv; undef *::qv; # avoid 'used once' warning
58 undef &declare; undef *::declare; # avoid 'used once' warning
61 diag "Tests with empty derived class" unless $ENV{PERL_CORE};
63 use_ok($package, 0.001);
64 my $testobj = $package->new(1.002_003);
65 isa_ok( $testobj, $package );
66 ok( $testobj->numify == 1.002003, "Numified correctly" );
67 ok( $testobj->stringify eq "1.002003", "Stringified correctly" );
68 ok( $testobj->normal eq "v1.2.3", "Normalified correctly" );
70 my $verobj = version::->new("1.2.4");
71 ok( $verobj > $testobj, "Comparison vs parent class" );
73 BaseTests($package, "new", "qv");
75 use_ok($package, 0.001, "declare");
76 BaseTests($package, "new", "declare");
78 use_ok($package, 0.001);
79 BaseTests($package, "parse", "qv");
81 use_ok($package, 0.001, "declare");
82 BaseTests($package, "parse", "declare");
84 diag "tests with bad subclass" unless $ENV{PERL_CORE};
85 $testobj = version::Bad->new(1.002_003);
86 isa_ok( $testobj, "version::Bad" );
87 eval { my $string = $testobj->numify };
88 like($@, qr/Invalid version object/,
89 "Bad subclass numify");
90 eval { my $string = $testobj->normal };
91 like($@, qr/Invalid version object/,
92 "Bad subclass normal");
93 eval { my $string = $testobj->stringify };
94 like($@, qr/Invalid version object/,
95 "Bad subclass stringify");
96 eval { my $test = ($testobj > 1.0) };
97 like($@, qr/Invalid version object/,
102 my ($CLASS, $method, $qv_declare) = @_;
104 local $SIG{__WARN__} = sub { $warning = $_[0] };
106 # Insert your test code below, the Test module is use()ed here so read
107 # its man page ( perldoc Test ) for help writing this test script.
109 # Test bare number processing
110 diag "tests with bare numbers" unless $ENV{PERL_CORE};
111 $version = $CLASS->$method(5.005_03);
112 is ( "$version" , "5.00503" , '5.005_03 eq 5.00503' );
113 $version = $CLASS->$method(1.23);
114 is ( "$version" , "1.23" , '1.23 eq "1.23"' );
116 # Test quoted number processing
117 diag "tests with quoted numbers" unless $ENV{PERL_CORE};
118 $version = $CLASS->$method("5.005_03");
119 is ( "$version" , "5.005_03" , '"5.005_03" eq "5.005_03"' );
120 $version = $CLASS->$method("v1.23");
121 is ( "$version" , "v1.23" , '"v1.23" eq "v1.23"' );
123 # Test stringify operator
124 diag "tests with stringify" unless $ENV{PERL_CORE};
125 $version = $CLASS->$method("5.005");
126 is ( "$version" , "5.005" , '5.005 eq "5.005"' );
127 $version = $CLASS->$method("5.006.001");
128 is ( "$version" , "5.006.001" , '5.006.001 eq v5.6.1' );
129 unlike ($warning, qr/v-string without leading 'v' deprecated/, 'No leading v');
130 $version = $CLASS->$method("v1.2.3_4");
131 is ( "$version" , "v1.2.3_4" , 'alpha version 1.2.3_4 eq v1.2.3_4' );
133 # test illegal formats
134 diag "test illegal formats" unless $ENV{PERL_CORE};
135 eval {my $version = $CLASS->$method("1.2_3_4")};
136 like($@, qr/multiple underscores/,
137 "Invalid version format (multiple underscores)");
139 eval {my $version = $CLASS->$method("1.2_3.4")};
140 like($@, qr/underscores before decimal/,
141 "Invalid version format (underscores before decimal)");
143 eval {my $version = $CLASS->$method("1_2")};
144 like($@, qr/alpha without decimal/,
145 "Invalid version format (alpha without decimal)");
147 # for this test, upgrade the warn() to die()
149 local $SIG{__WARN__} = sub { die $_[0] };
150 $version = $CLASS->$method("1.2b3");
152 my $warnregex = "Version string '.+' contains invalid data; ".
155 like($@, qr/$warnregex/,
156 "Version string contains invalid data; ignoring");
158 # from here on out capture the warning and test independently
160 $version = $CLASS->$method("99 and 44/100 pure");
162 like($warning, qr/$warnregex/,
163 "Version string contains invalid data; ignoring");
164 is ("$version", "99", '$version eq "99"');
165 ok ($version->numify == 99.0, '$version->numify == 99.0');
166 ok ($version->normal eq "v99.0.0", '$version->normal eq v99.0.0');
168 $version = $CLASS->$method("something");
169 like($warning, qr/$warnregex/,
170 "Version string contains invalid data; ignoring");
171 ok (defined $version, 'defined $version');
173 # reset the test object to something reasonable
174 $version = $CLASS->$method("1.2.3");
176 # Test boolean operator
177 ok ($version, 'boolean');
179 # Test class membership
180 isa_ok ( $version, $CLASS );
182 # Test comparison operators with self
183 diag "tests with self" unless $ENV{PERL_CORE};
184 is ( $version <=> $version, 0, '$version <=> $version == 0' );
185 ok ( $version == $version, '$version == $version' );
187 # Test Numeric Comparison operators
188 # test first with non-object
189 $version = $CLASS->$method("5.006.001");
190 $new_version = "5.8.0";
191 diag "numeric tests with non-objects" unless $ENV{PERL_CORE};
192 ok ( $version == $version, '$version == $version' );
193 ok ( $version < $new_version, '$version < $new_version' );
194 ok ( $new_version > $version, '$new_version > $version' );
195 ok ( $version != $new_version, '$version != $new_version' );
197 # now test with existing object
198 $new_version = $CLASS->$method($new_version);
199 diag "numeric tests with objects" unless $ENV{PERL_CORE};
200 ok ( $version < $new_version, '$version < $new_version' );
201 ok ( $new_version > $version, '$new_version > $version' );
202 ok ( $version != $new_version, '$version != $new_version' );
204 # now test with actual numbers
205 diag "numeric tests with numbers" unless $ENV{PERL_CORE};
206 ok ( $version->numify() == 5.006001, '$version->numify() == 5.006001' );
207 ok ( $version->numify() <= 5.006001, '$version->numify() <= 5.006001' );
208 ok ( $version->numify() < 5.008, '$version->numify() < 5.008' );
209 #ok ( $version->numify() > v5.005_02, '$version->numify() > 5.005_02' );
211 # test with long decimals
212 diag "Tests with extended decimal versions" unless $ENV{PERL_CORE};
213 $version = $CLASS->$method(1.002003);
214 ok ( $version == "1.2.3", '$version == "1.2.3"');
215 ok ( $version->numify == 1.002003, '$version->numify == 1.002003');
216 $version = $CLASS->$method("2002.09.30.1");
217 ok ( $version == "2002.9.30.1",'$version == 2002.9.30.1');
218 ok ( $version->numify == 2002.009030001,
219 '$version->numify == 2002.009030001');
221 # now test with alpha version form with string
222 $version = $CLASS->$method("1.2.3");
223 $new_version = "1.2.3_4";
224 diag "numeric tests with alpha-style non-objects" unless $ENV{PERL_CORE};
225 ok ( $version < $new_version, '$version < $new_version' );
226 ok ( $new_version > $version, '$new_version > $version' );
227 ok ( $version != $new_version, '$version != $new_version' );
229 $version = $CLASS->$method("1.2.4");
230 diag "numeric tests with alpha-style non-objects"
231 unless $ENV{PERL_CORE};
232 ok ( $version > $new_version, '$version > $new_version' );
233 ok ( $new_version < $version, '$new_version < $version' );
234 ok ( $version != $new_version, '$version != $new_version' );
236 # now test with alpha version form with object
237 $version = $CLASS->$method("1.2.3");
238 $new_version = $CLASS->$method("1.2.3_4");
239 diag "tests with alpha-style objects" unless $ENV{PERL_CORE};
240 ok ( $version < $new_version, '$version < $new_version' );
241 ok ( $new_version > $version, '$new_version > $version' );
242 ok ( $version != $new_version, '$version != $new_version' );
243 ok ( !$version->is_alpha, '!$version->is_alpha');
244 ok ( $new_version->is_alpha, '$new_version->is_alpha');
246 $version = $CLASS->$method("1.2.4");
247 diag "tests with alpha-style objects" unless $ENV{PERL_CORE};
248 ok ( $version > $new_version, '$version > $new_version' );
249 ok ( $new_version < $version, '$new_version < $version' );
250 ok ( $version != $new_version, '$version != $new_version' );
252 $version = $CLASS->$method("1.2.3.4");
253 $new_version = $CLASS->$method("1.2.3_4");
254 diag "tests with alpha-style objects with same subversion"
255 unless $ENV{PERL_CORE};
256 ok ( $version > $new_version, '$version > $new_version' );
257 ok ( $new_version < $version, '$new_version < $version' );
258 ok ( $version != $new_version, '$version != $new_version' );
260 diag "test implicit [in]equality" unless $ENV{PERL_CORE};
261 $version = $CLASS->$method("v1.2.3");
262 $new_version = $CLASS->$method("1.2.3.0");
263 ok ( $version == $new_version, '$version == $new_version' );
264 $new_version = $CLASS->$method("1.2.3_0");
265 ok ( $version == $new_version, '$version == $new_version' );
266 $new_version = $CLASS->$method("1.2.3.1");
267 ok ( $version < $new_version, '$version < $new_version' );
268 $new_version = $CLASS->$method("1.2.3_1");
269 ok ( $version < $new_version, '$version < $new_version' );
270 $new_version = $CLASS->$method("1.1.999");
271 ok ( $version > $new_version, '$version > $new_version' );
273 # that which is not expressly permitted is forbidden
274 diag "forbidden operations" unless $ENV{PERL_CORE};
275 ok ( !eval { ++$version }, "noop ++" );
276 ok ( !eval { --$version }, "noop --" );
277 ok ( !eval { $version/1 }, "noop /" );
278 ok ( !eval { $version*3 }, "noop *" );
279 ok ( !eval { abs($version) }, "noop abs" );
282 skip "version require'd instead of use'd, cannot test $qv_declare", 3
283 unless defined $qv_declare;
284 # test the $qv_declare() sub
285 diag "testing $qv_declare" unless $ENV{PERL_CORE};
286 $version = $CLASS->$qv_declare("1.2");
287 is ( "$version", "v1.2", $qv_declare.'("1.2") == "1.2.0"' );
288 $version = $CLASS->$qv_declare(1.2);
289 is ( "$version", "v1.2", $qv_declare.'(1.2) == "1.2.0"' );
290 isa_ok( $CLASS->$qv_declare('5.008'), $CLASS );
293 # test creation from existing version object
294 diag "create new from existing version" unless $ENV{PERL_CORE};
295 ok (eval {$new_version = $CLASS->$method($version)},
296 "new from existing object");
297 ok ($new_version == $version, "class->$method($version) identical");
298 $new_version = $version->$method();
299 isa_ok ($new_version, $CLASS );
300 is ($new_version, "0", "version->$method() doesn't clone");
301 $new_version = $version->$method("1.2.3");
302 is ($new_version, "1.2.3" , '$version->$method("1.2.3") works too');
304 # test the CVS revision mode
305 diag "testing CVS Revision" unless $ENV{PERL_CORE};
306 $version = new $CLASS qw$Revision: 1.2$;
307 ok ( $version == "1.2.0", 'qw$Revision: 1.2$ == 1.2.0' );
308 $version = new $CLASS qw$Revision: 1.2.3.4$;
309 ok ( $version == "1.2.3.4", 'qw$Revision: 1.2.3.4$ == 1.2.3.4' );
311 # test the CPAN style reduced significant digit form
312 diag "testing CPAN-style versions" unless $ENV{PERL_CORE};
313 $version = $CLASS->$method("1.23_01");
314 is ( "$version" , "1.23_01", "CPAN-style alpha version" );
315 ok ( $version > 1.23, "1.23_01 > 1.23");
316 ok ( $version < 1.24, "1.23_01 < 1.24");
318 # test reformed UNIVERSAL::VERSION
319 diag "Replacement UNIVERSAL::VERSION tests" unless $ENV{PERL_CORE};
321 my $error_regex = $] < 5.006
322 ? 'version \d required'
323 : 'does not define \$t.{7}::VERSION';
326 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
327 (my $package = basename($filename)) =~ s/\.pm$//;
328 print $fh "package $package;\n\$$package\::VERSION=0.58;\n1;\n";
332 eval "use lib '.'; use $package $version";
333 unlike($@, qr/$package version $version/,
334 'Replacement eval works with exact version');
336 # test as class method
337 $new_version = $package->VERSION;
338 cmp_ok($new_version,'==',$version, "Called as class method");
340 eval "print Completely::Unknown::Module->VERSION";
342 unlike($@, qr/$error_regex/,
343 "Don't freak if the module doesn't even exist");
346 unlike($@, qr/defines neither package nor VERSION/,
347 "Don't freak if the module doesn't even exist");
350 # this should fail even with old UNIVERSAL::VERSION
352 eval "use lib '.'; use $package $version";
353 like($@, qr/$package version $version/,
354 'Replacement eval works with incremented version');
356 $version =~ s/0+$//; #convert to string and remove trailing 0's
357 chop($version); # shorten by 1 digit, should still succeed
358 eval "use lib '.'; use $package $version";
359 unlike($@, qr/$package version $version/,
360 'Replacement eval works with single digit');
362 # this would fail with old UNIVERSAL::VERSION
364 eval "use lib '.'; use $package $version";
365 like($@, qr/$package version $version/,
366 'Replacement eval works with incremented digit');
370 { # dummy up some variously broken modules for testing
371 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
372 (my $package = basename($filename)) =~ s/\.pm$//;
376 eval "use lib '.'; use $package 3;";
378 like($@, qr/$error_regex/,
379 'Replacement handles modules without package or VERSION');
382 like($@, qr/defines neither package nor VERSION/,
383 'Replacement handles modules without package or VERSION');
385 eval "use lib '.'; use $package; \$version = $package->VERSION";
386 unlike ($@, qr/$error_regex/,
387 'Replacement handles modules without package or VERSION');
388 ok (!defined($version), "Called as class method");
392 { # dummy up some variously broken modules for testing
393 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
394 (my $package = basename($filename)) =~ s/\.pm$//;
395 print $fh "package $package;\n#look ma no VERSION\n1;\n";
397 eval "use lib '.'; use $package 3;";
398 like ($@, qr/$error_regex/,
399 'Replacement handles modules without VERSION');
400 eval "use lib '.'; use $package; print $package->VERSION";
401 unlike ($@, qr/$error_regex/,
402 'Replacement handles modules without VERSION');
406 { # dummy up some variously broken modules for testing
407 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
408 (my $package = basename($filename)) =~ s/\.pm$//;
409 print $fh "package $package;\n\@VERSION = ();\n1;\n";
411 eval "use lib '.'; use $package 3;";
412 like ($@, qr/$error_regex/,
413 'Replacement handles modules without VERSION');
414 eval "use lib '.'; use $package; print $package->VERSION";
415 unlike ($@, qr/$error_regex/,
416 'Replacement handles modules without VERSION');
421 skip 'Cannot test bare v-strings with Perl < 5.6.0', 4
423 diag "Tests with v-strings" unless $ENV{PERL_CORE};
424 $version = $CLASS->$method(1.2.3);
425 ok("$version" == "v1.2.3", '"$version" == 1.2.3');
426 $version = $CLASS->$method(1.0.0);
427 $new_version = $CLASS->$method(1);
428 ok($version == $new_version, '$version == $new_version');
429 skip "version require'd instead of use'd, cannot test declare", 1
430 unless defined $qv_declare;
431 $version = &$qv_declare(1.2.3);
432 ok("$version" == "v1.2.3", 'v-string initialized $qv_declare()');
435 diag "Tests with real-world (malformed) data" unless $ENV{PERL_CORE};
437 # trailing zero testing (reported by Andreas Koenig).
438 $version = $CLASS->$method("1");
439 ok($version->numify eq "1.000", "trailing zeros preserved");
440 $version = $CLASS->$method("1.0");
441 ok($version->numify eq "1.000", "trailing zeros preserved");
442 $version = $CLASS->$method("1.0.0");
443 ok($version->numify eq "1.000000", "trailing zeros preserved");
444 $version = $CLASS->$method("1.0.0.0");
445 ok($version->numify eq "1.000000000", "trailing zeros preserved");
447 # leading zero testing (reported by Andreas Koenig).
448 $version = $CLASS->$method(".7");
449 ok($version->numify eq "0.700", "leading zero inferred");
451 # leading space testing (reported by Andreas Koenig).
452 $version = $CLASS->$method(" 1.7");
453 ok($version->numify eq "1.700", "leading space ignored");
455 # RT 19517 - deal with undef and 'undef' initialization
456 ok("$version" ne 'undef', "Undef version comparison #1");
457 ok("$version" ne undef, "Undef version comparison #2");
458 $version = $CLASS->$method('undef');
459 unlike($warning, qr/^Version string 'undef' contains invalid data/,
460 "Version string 'undef'");
462 $version = $CLASS->$method(undef);
463 like($warning, qr/^Use of uninitialized value/,
464 "Version string 'undef'");
465 ok($version == 'undef', "Undef version comparison #3");
466 ok($version == undef, "Undef version comparison #4");
467 eval "\$version = \$CLASS->$method()"; # no parameter at all
468 unlike($@, qr/^Bizarre copy of CODE/, "No initializer at all");
469 ok($version == 'undef', "Undef version comparison #5");
470 ok($version == undef, "Undef version comparison #6");
472 $version = $CLASS->$method(0.000001);
473 unlike($warning, qr/^Version string '1e-06' contains invalid data/,
474 "Very small version objects");
479 local $SIG{__WARN__} = sub { $warning = $_[0] };
480 # dummy up a legal module for testing RT#19017
481 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
482 (my $package = basename($filename)) =~ s/\.pm$//;
485 use $CLASS; \$VERSION = ${CLASS}->new('0.0.4');
490 eval "use lib '.'; use $package 0.000008;";
491 like ($@, qr/^$package version 0.000008 required/,
492 "Make sure very small versions don't freak");
493 eval "use lib '.'; use $package 1;";
494 like ($@, qr/^$package version 1 required/,
495 "Comparing vs. version with no decimal");
496 eval "use lib '.'; use $package 1.;";
497 like ($@, qr/^$package version 1 required/,
498 "Comparing vs. version with decimal only");
499 if ( $] < 5.006_000 ) {
500 skip 'Cannot "use" extended versions with Perl < 5.6.0', 3;
502 eval "use lib '.'; use $package v0.0.8;";
503 my $regex = "^$package version v0.0.8 required";
504 like ($@, qr/$regex/, "Make sure very small versions don't freak");
506 $regex =~ s/8/4/; # set for second test
507 eval "use lib '.'; use $package v0.0.4;";
508 unlike($@, qr/$regex/, 'Succeed - required == VERSION');
509 cmp_ok ( $package->VERSION, 'eq', '0.0.4', 'No undef warnings' );
514 skip 'Cannot test "use base qw(version)" when require is used', 3
515 unless defined $qv_declare;
516 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
517 (my $package = basename($filename)) =~ s/\.pm$//;
520 use base qw(version);
524 # need to eliminate any other $qv_declare()'s
525 undef *{"main\::$qv_declare"};
526 ok(!defined(&{"main\::$qv_declare"}), "make sure we cleared $qv_declare() properly");
527 eval "use lib '.'; use $package qw/declare qv/;";
528 ok(defined(&{"main\::$qv_declare"}), "make sure we exported $qv_declare() properly");
529 isa_ok( &$qv_declare(1.2), $package);
534 if ( $] < 5.006_000 ) {
535 skip 'Cannot "use" extended versions with Perl < 5.6.0', 3;
537 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
538 (my $package = basename($filename)) =~ s/\.pm$//;
545 eval "use lib '.'; use $package 1.001;";
546 like ($@, qr/^$package version 1.001 required/,
547 "User typed numeric so we error with numeric");
548 eval "use lib '.'; use $package v1.1.0;";
549 like ($@, qr/^$package version v1.1.0 required/,
550 "User typed extended so we error with extended");
555 # test locale handling
557 local $SIG{__WARN__} = sub { $warning = $_[0] };
560 my $v = $CLASS->$method('1,7');
561 unlike($warning, qr"Version string '1,7' contains invalid data",
562 'Directly test comma as decimal compliance');
564 my $ver = 1.23; # has to be floating point number
565 my $orig_loc = setlocale( LC_ALL );
569 $loc = setlocale( LC_ALL, $_);
570 last if localeconv()->{decimal_point} eq ',';
572 skip 'Cannot test locale handling without a comma locale', 4
573 unless ( $loc and ($ver eq '1,23') );
575 diag ("Testing locale handling with $loc") unless $ENV{PERL_CORE};
577 $v = $CLASS->$method($ver);
578 unlike($warning, qr/Version string '1,23' contains invalid data/,
579 "Process locale-dependent floating point");
580 is ($v, "1.23", "Locale doesn't apply to version objects");
581 ok ($v == $ver, "Comparison to locale floating point");
583 setlocale( LC_ALL, $orig_loc); # reset this before possible skip
584 skip 'Cannot test RT#46921 with Perl < 5.008', 1
586 skip 'Cannot test RT#46921 with pure Perl module', 1
587 if exists $INC{'version/vpp.pm'};
588 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
589 (my $package = basename($filename)) =~ s/\.pm$//;
592 use POSIX qw(locale_h);
595 setlocale (LC_ALL, '$loc');
597 eval "use Socket 1.7";
598 setlocale( LC_ALL, '$orig_loc');
603 eval "use lib '.'; use $package;";
604 unlike($warning, qr"Version string '1,7' contains invalid data",
605 'Handle locale action-at-a-distance');
608 eval 'my $v = $CLASS->$method("1._1");';
609 unlike($@, qr/^Invalid version format \(alpha with zero width\)/,
610 "Invalid version format 1._1");
614 local $SIG{__WARN__} = sub { $warning = $_[0] };
615 eval 'my $v = $CLASS->$method(~0);';
616 unlike($@, qr/Integer overflow in version/, "Too large version");
617 like($warning, qr/Integer overflow in version/, "Too large version");
621 # http://rt.cpan.org/Public/Bug/Display.html?id=30004
622 my $v1 = $CLASS->$method("v0.1_1");
623 (my $alpha1 = Dumper($v1)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms;
624 my $v2 = $CLASS->$method($v1);
625 (my $alpha2 = Dumper($v2)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms;
626 is $alpha2, $alpha1, "Don't fall for Data::Dumper's tricks";
630 # http://rt.perl.org/rt3/Ticket/Display.html?id=56606
631 my $badv = bless { version => [1,2,3] }, "version";
632 is $badv, '1.002003', "Deal with badly serialized versions from YAML";
633 my $badv2 = bless { qv => 1, version => [1,2,3] }, "version";
634 is $badv2, 'v1.2.3', "Deal with badly serialized versions from YAML ";