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 # Insert your test code below, the Test module is use()ed here so read
105 # its man page ( perldoc Test ) for help writing this test script.
107 # Test bare number processing
108 diag "tests with bare numbers" unless $ENV{PERL_CORE};
109 $version = $CLASS->$method(5.005_03);
110 is ( "$version" , "5.00503" , '5.005_03 eq 5.00503' );
111 $version = $CLASS->$method(1.23);
112 is ( "$version" , "1.23" , '1.23 eq "1.23"' );
114 # Test quoted number processing
115 diag "tests with quoted numbers" unless $ENV{PERL_CORE};
116 $version = $CLASS->$method("5.005_03");
117 is ( "$version" , "5.005_03" , '"5.005_03" eq "5.005_03"' );
118 $version = $CLASS->$method("v1.23");
119 is ( "$version" , "v1.23" , '"v1.23" eq "v1.23"' );
121 # Test stringify operator
122 diag "tests with stringify" unless $ENV{PERL_CORE};
123 $version = $CLASS->$method("5.005");
124 is ( "$version" , "5.005" , '5.005 eq "5.005"' );
125 $version = $CLASS->$method("5.006.001");
126 is ( "$version" , "5.006.001" , '5.006.001 eq v5.6.1' );
127 $version = $CLASS->$method("1.2.3_4");
128 is ( "$version" , "1.2.3_4" , 'alpha version 1.2.3_4 eq v1.2.3_4' );
130 # test illegal formats
131 diag "test illegal formats" unless $ENV{PERL_CORE};
132 eval {my $version = $CLASS->$method("1.2_3_4")};
133 like($@, qr/multiple underscores/,
134 "Invalid version format (multiple underscores)");
136 eval {my $version = $CLASS->$method("1.2_3.4")};
137 like($@, qr/underscores before decimal/,
138 "Invalid version format (underscores before decimal)");
140 eval {my $version = $CLASS->$method("1_2")};
141 like($@, qr/alpha without decimal/,
142 "Invalid version format (alpha without decimal)");
144 # for this first test, just upgrade the warn() to die()
146 local $SIG{__WARN__} = sub { die $_[0] };
147 $version = $CLASS->$method("1.2b3");
149 my $warnregex = "Version string '.+' contains invalid data; ".
152 like($@, qr/$warnregex/,
153 "Version string contains invalid data; ignoring");
155 # from here on out capture the warning and test independently
158 local $SIG{__WARN__} = sub { $warning = $_[0] };
159 $version = $CLASS->$method("99 and 44/100 pure");
161 like($warning, qr/$warnregex/,
162 "Version string contains invalid data; ignoring");
163 is ("$version", "99", '$version eq "99"');
164 ok ($version->numify == 99.0, '$version->numify == 99.0');
165 ok ($version->normal eq "v99.0.0", '$version->normal eq v99.0.0');
167 $version = $CLASS->$method("something");
168 like($warning, qr/$warnregex/,
169 "Version string contains invalid data; ignoring");
170 ok (defined $version, 'defined $version');
172 # reset the test object to something reasonable
173 $version = $CLASS->$method("1.2.3");
175 # Test boolean operator
176 ok ($version, 'boolean');
178 # Test class membership
179 isa_ok ( $version, $CLASS );
181 # Test comparison operators with self
182 diag "tests with self" unless $ENV{PERL_CORE};
183 is ( $version <=> $version, 0, '$version <=> $version == 0' );
184 ok ( $version == $version, '$version == $version' );
186 # Test Numeric Comparison operators
187 # test first with non-object
188 $version = $CLASS->$method("5.006.001");
189 $new_version = "5.8.0";
190 diag "numeric tests with non-objects" unless $ENV{PERL_CORE};
191 ok ( $version == $version, '$version == $version' );
192 ok ( $version < $new_version, '$version < $new_version' );
193 ok ( $new_version > $version, '$new_version > $version' );
194 ok ( $version != $new_version, '$version != $new_version' );
196 # now test with existing object
197 $new_version = $CLASS->$method($new_version);
198 diag "numeric tests with objects" unless $ENV{PERL_CORE};
199 ok ( $version < $new_version, '$version < $new_version' );
200 ok ( $new_version > $version, '$new_version > $version' );
201 ok ( $version != $new_version, '$version != $new_version' );
203 # now test with actual numbers
204 diag "numeric tests with numbers" unless $ENV{PERL_CORE};
205 ok ( $version->numify() == 5.006001, '$version->numify() == 5.006001' );
206 ok ( $version->numify() <= 5.006001, '$version->numify() <= 5.006001' );
207 ok ( $version->numify() < 5.008, '$version->numify() < 5.008' );
208 #ok ( $version->numify() > v5.005_02, '$version->numify() > 5.005_02' );
210 # test with long decimals
211 diag "Tests with extended decimal versions" unless $ENV{PERL_CORE};
212 $version = $CLASS->$method(1.002003);
213 ok ( $version == "1.2.3", '$version == "1.2.3"');
214 ok ( $version->numify == 1.002003, '$version->numify == 1.002003');
215 $version = $CLASS->$method("2002.09.30.1");
216 ok ( $version == "2002.9.30.1",'$version == 2002.9.30.1');
217 ok ( $version->numify == 2002.009030001,
218 '$version->numify == 2002.009030001');
220 # now test with alpha version form with string
221 $version = $CLASS->$method("1.2.3");
222 $new_version = "1.2.3_4";
223 diag "numeric tests with alpha-style non-objects" unless $ENV{PERL_CORE};
224 ok ( $version < $new_version, '$version < $new_version' );
225 ok ( $new_version > $version, '$new_version > $version' );
226 ok ( $version != $new_version, '$version != $new_version' );
228 $version = $CLASS->$method("1.2.4");
229 diag "numeric tests with alpha-style non-objects"
231 ok ( $version > $new_version, '$version > $new_version' );
232 ok ( $new_version < $version, '$new_version < $version' );
233 ok ( $version != $new_version, '$version != $new_version' );
235 # now test with alpha version form with object
236 $version = $CLASS->$method("1.2.3");
237 $new_version = $CLASS->$method("1.2.3_4");
238 diag "tests with alpha-style objects" unless $ENV{PERL_CORE};
239 ok ( $version < $new_version, '$version < $new_version' );
240 ok ( $new_version > $version, '$new_version > $version' );
241 ok ( $version != $new_version, '$version != $new_version' );
242 ok ( !$version->is_alpha, '!$version->is_alpha');
243 ok ( $new_version->is_alpha, '$new_version->is_alpha');
245 $version = $CLASS->$method("1.2.4");
246 diag "tests with alpha-style objects" unless $ENV{PERL_CORE};
247 ok ( $version > $new_version, '$version > $new_version' );
248 ok ( $new_version < $version, '$new_version < $version' );
249 ok ( $version != $new_version, '$version != $new_version' );
251 $version = $CLASS->$method("1.2.3.4");
252 $new_version = $CLASS->$method("1.2.3_4");
253 diag "tests with alpha-style objects with same subversion"
255 ok ( $version > $new_version, '$version > $new_version' );
256 ok ( $new_version < $version, '$new_version < $version' );
257 ok ( $version != $new_version, '$version != $new_version' );
259 diag "test implicit [in]equality" unless $ENV{PERL_CORE};
260 $version = $CLASS->$method("v1.2.3");
261 $new_version = $CLASS->$method("1.2.3.0");
262 ok ( $version == $new_version, '$version == $new_version' );
263 $new_version = $CLASS->$method("1.2.3_0");
264 ok ( $version == $new_version, '$version == $new_version' );
265 $new_version = $CLASS->$method("1.2.3.1");
266 ok ( $version < $new_version, '$version < $new_version' );
267 $new_version = $CLASS->$method("1.2.3_1");
268 ok ( $version < $new_version, '$version < $new_version' );
269 $new_version = $CLASS->$method("1.1.999");
270 ok ( $version > $new_version, '$version > $new_version' );
272 # that which is not expressly permitted is forbidden
273 diag "forbidden operations" unless $ENV{PERL_CORE};
274 ok ( !eval { ++$version }, "noop ++" );
275 ok ( !eval { --$version }, "noop --" );
276 ok ( !eval { $version/1 }, "noop /" );
277 ok ( !eval { $version*3 }, "noop *" );
278 ok ( !eval { abs($version) }, "noop abs" );
281 skip "version require'd instead of use'd, cannot test $qv_declare", 3
282 unless defined $qv_declare;
283 # test the $qv_declare() sub
284 diag "testing $qv_declare" unless $ENV{PERL_CORE};
285 $version = $CLASS->$qv_declare("1.2");
286 is ( "$version", "v1.2", $qv_declare.'("1.2") == "1.2.0"' );
287 $version = $CLASS->$qv_declare(1.2);
288 is ( "$version", "v1.2", $qv_declare.'(1.2) == "1.2.0"' );
289 isa_ok( $CLASS->$qv_declare('5.008'), $CLASS );
292 # test creation from existing version object
293 diag "create new from existing version" unless $ENV{PERL_CORE};
294 ok (eval {$new_version = $CLASS->$method($version)},
295 "new from existing object");
296 ok ($new_version == $version, "class->$method($version) identical");
297 $new_version = $version->$method();
298 isa_ok ($new_version, $CLASS );
299 is ($new_version, "0", "version->$method() doesn't clone");
300 $new_version = $version->$method("1.2.3");
301 is ($new_version, "1.2.3" , '$version->$method("1.2.3") works too');
303 # test the CVS revision mode
304 diag "testing CVS Revision" unless $ENV{PERL_CORE};
305 $version = new $CLASS qw$Revision: 1.2$;
306 ok ( $version == "1.2.0", 'qw$Revision: 1.2$ == 1.2.0' );
307 $version = new $CLASS qw$Revision: 1.2.3.4$;
308 ok ( $version == "1.2.3.4", 'qw$Revision: 1.2.3.4$ == 1.2.3.4' );
310 # test the CPAN style reduced significant digit form
311 diag "testing CPAN-style versions" unless $ENV{PERL_CORE};
312 $version = $CLASS->$method("1.23_01");
313 is ( "$version" , "1.23_01", "CPAN-style alpha version" );
314 ok ( $version > 1.23, "1.23_01 > 1.23");
315 ok ( $version < 1.24, "1.23_01 < 1.24");
317 # test reformed UNIVERSAL::VERSION
318 diag "Replacement UNIVERSAL::VERSION tests" unless $ENV{PERL_CORE};
320 my $error_regex = $] < 5.006
321 ? 'version \d required'
322 : 'does not define \$t.{7}::VERSION';
325 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
326 (my $package = basename($filename)) =~ s/\.pm$//;
327 print $fh "package $package;\n\$$package\::VERSION=0.58;\n1;\n";
331 eval "use lib '.'; use $package $version";
332 unlike($@, qr/$package version $version/,
333 'Replacement eval works with exact version');
335 # test as class method
336 $new_version = $package->VERSION;
337 cmp_ok($new_version,'==',$version, "Called as class method");
339 eval "print Completely::Unknown::Module->VERSION";
341 unlike($@, qr/$error_regex/,
342 "Don't freak if the module doesn't even exist");
345 unlike($@, qr/defines neither package nor VERSION/,
346 "Don't freak if the module doesn't even exist");
349 # this should fail even with old UNIVERSAL::VERSION
351 eval "use lib '.'; use $package $version";
352 like($@, qr/$package version $version/,
353 'Replacement eval works with incremented version');
355 $version =~ s/0+$//; #convert to string and remove trailing 0's
356 chop($version); # shorten by 1 digit, should still succeed
357 eval "use lib '.'; use $package $version";
358 unlike($@, qr/$package version $version/,
359 'Replacement eval works with single digit');
361 # this would fail with old UNIVERSAL::VERSION
363 eval "use lib '.'; use $package $version";
364 like($@, qr/$package version $version/,
365 'Replacement eval works with incremented digit');
369 { # dummy up some variously broken modules for testing
370 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
371 (my $package = basename($filename)) =~ s/\.pm$//;
375 eval "use lib '.'; use $package 3;";
377 like($@, qr/$error_regex/,
378 'Replacement handles modules without package or VERSION');
381 like($@, qr/defines neither package nor VERSION/,
382 'Replacement handles modules without package or VERSION');
384 eval "use lib '.'; use $package; \$version = $package->VERSION";
385 unlike ($@, qr/$error_regex/,
386 'Replacement handles modules without package or VERSION');
387 ok (!defined($version), "Called as class method");
391 { # dummy up some variously broken modules for testing
392 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
393 (my $package = basename($filename)) =~ s/\.pm$//;
394 print $fh "package $package;\n#look ma no VERSION\n1;\n";
396 eval "use lib '.'; use $package 3;";
397 like ($@, qr/$error_regex/,
398 'Replacement handles modules without VERSION');
399 eval "use lib '.'; use $package; print $package->VERSION";
400 unlike ($@, qr/$error_regex/,
401 'Replacement handles modules without VERSION');
405 { # dummy up some variously broken modules for testing
406 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
407 (my $package = basename($filename)) =~ s/\.pm$//;
408 print $fh "package $package;\n\@VERSION = ();\n1;\n";
410 eval "use lib '.'; use $package 3;";
411 like ($@, qr/$error_regex/,
412 'Replacement handles modules without VERSION');
413 eval "use lib '.'; use $package; print $package->VERSION";
414 unlike ($@, qr/$error_regex/,
415 'Replacement handles modules without VERSION');
420 skip 'Cannot test bare v-strings with Perl < 5.6.0', 4
422 diag "Tests with v-strings" unless $ENV{PERL_CORE};
423 $version = $CLASS->$method(1.2.3);
424 ok("$version" == "v1.2.3", '"$version" == 1.2.3');
425 $version = $CLASS->$method(1.0.0);
426 $new_version = $CLASS->$method(1);
427 ok($version == $new_version, '$version == $new_version');
428 skip "version require'd instead of use'd, cannot test declare", 1
429 unless defined $qv_declare;
430 $version = &$qv_declare(1.2.3);
431 ok("$version" == "v1.2.3", 'v-string initialized $qv_declare()');
434 diag "Tests with real-world (malformed) data" unless $ENV{PERL_CORE};
436 # trailing zero testing (reported by Andreas Koenig).
437 $version = $CLASS->$method("1");
438 ok($version->numify eq "1.000", "trailing zeros preserved");
439 $version = $CLASS->$method("1.0");
440 ok($version->numify eq "1.000", "trailing zeros preserved");
441 $version = $CLASS->$method("1.0.0");
442 ok($version->numify eq "1.000000", "trailing zeros preserved");
443 $version = $CLASS->$method("1.0.0.0");
444 ok($version->numify eq "1.000000000", "trailing zeros preserved");
446 # leading zero testing (reported by Andreas Koenig).
447 $version = $CLASS->$method(".7");
448 ok($version->numify eq "0.700", "leading zero inferred");
450 # leading space testing (reported by Andreas Koenig).
451 $version = $CLASS->$method(" 1.7");
452 ok($version->numify eq "1.700", "leading space ignored");
454 # RT 19517 - deal with undef and 'undef' initialization
455 ok("$version" ne 'undef', "Undef version comparison #1");
456 ok("$version" ne undef, "Undef version comparison #2");
457 $version = $CLASS->$method('undef');
458 unlike($warning, qr/^Version string 'undef' contains invalid data/,
459 "Version string 'undef'");
461 $version = $CLASS->$method(undef);
462 like($warning, qr/^Use of uninitialized value/,
463 "Version string 'undef'");
464 ok($version == 'undef', "Undef version comparison #3");
465 ok($version == undef, "Undef version comparison #4");
466 eval "\$version = \$CLASS->$method()"; # no parameter at all
467 unlike($@, qr/^Bizarre copy of CODE/, "No initializer at all");
468 ok($version == 'undef', "Undef version comparison #5");
469 ok($version == undef, "Undef version comparison #6");
471 $version = $CLASS->$method(0.000001);
472 unlike($warning, qr/^Version string '1e-06' contains invalid data/,
473 "Very small version objects");
478 local $SIG{__WARN__} = sub { $warning = $_[0] };
479 # dummy up a legal module for testing RT#19017
480 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
481 (my $package = basename($filename)) =~ s/\.pm$//;
484 use $CLASS; \$VERSION = ${CLASS}->new('0.0.4');
489 eval "use lib '.'; use $package 0.000008;";
490 like ($@, qr/^$package version 0.000008 required/,
491 "Make sure very small versions don't freak");
492 eval "use lib '.'; use $package 1;";
493 like ($@, qr/^$package version 1 required/,
494 "Comparing vs. version with no decimal");
495 eval "use lib '.'; use $package 1.;";
496 like ($@, qr/^$package version 1 required/,
497 "Comparing vs. version with decimal only");
498 if ( $] < 5.006_000 ) {
499 skip 'Cannot "use" extended versions with Perl < 5.6.0', 3;
501 eval "use lib '.'; use $package v0.0.8;";
502 my $regex = "^$package version v0.0.8 required";
503 like ($@, qr/$regex/, "Make sure very small versions don't freak");
505 $regex =~ s/8/4/; # set for second test
506 eval "use lib '.'; use $package v0.0.4;";
507 unlike($@, qr/$regex/, 'Succeed - required == VERSION');
508 cmp_ok ( $package->VERSION, 'eq', '0.0.4', 'No undef warnings' );
513 skip 'Cannot test "use base qw(version)" when require is used', 3
514 unless defined $qv_declare;
515 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
516 (my $package = basename($filename)) =~ s/\.pm$//;
519 use base qw(version);
523 # need to eliminate any other $qv_declare()'s
524 undef *{"main\::$qv_declare"};
525 ok(!defined(&{"main\::$qv_declare"}), "make sure we cleared $qv_declare() properly");
526 eval "use lib '.'; use $package qw/declare qv/;";
527 ok(defined(&{"main\::$qv_declare"}), "make sure we exported $qv_declare() properly");
528 isa_ok( &$qv_declare(1.2), $package);
533 if ( $] < 5.006_000 ) {
534 skip 'Cannot "use" extended versions with Perl < 5.6.0', 3;
536 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
537 (my $package = basename($filename)) =~ s/\.pm$//;
544 eval "use lib '.'; use $package 1.001;";
545 like ($@, qr/^$package version 1.001 required/,
546 "User typed numeric so we error with numeric");
547 eval "use lib '.'; use $package v1.1.0;";
548 like ($@, qr/^$package version v1.1.0 required/,
549 "User typed extended so we error with extended");
554 # test locale handling
556 local $SIG{__WARN__} = sub { $warning = $_[0] };
559 my $v = $CLASS->$method('1,7');
560 unlike($warning, qr"Version string '1,7' contains invalid data",
561 'Directly test comma as decimal compliance');
563 my $ver = 1.23; # has to be floating point number
564 my $orig_loc = setlocale( LC_ALL );
568 $loc = setlocale( LC_ALL, $_);
569 last if localeconv()->{decimal_point} eq ',';
571 skip 'Cannot test locale handling without a comma locale', 4
572 unless ( $loc and ($ver eq '1,23') );
574 diag ("Testing locale handling with $loc") unless $ENV{PERL_CORE};
576 $v = $CLASS->$method($ver);
577 unlike($warning, qr/Version string '1,23' contains invalid data/,
578 "Process locale-dependent floating point");
579 is ($v, "1.23", "Locale doesn't apply to version objects");
580 ok ($v == $ver, "Comparison to locale floating point");
582 setlocale( LC_ALL, $orig_loc); # reset this before possible skip
583 skip 'Cannot test RT#46921 with Perl < 5.008', 1
585 skip 'Cannot test RT#46921 with pure Perl module', 1
586 if exists $INC{'version/vpp.pm'};
587 my ($fh, $filename) = tempfile('tXXXXXXX', SUFFIX => '.pm', UNLINK => 1);
588 (my $package = basename($filename)) =~ s/\.pm$//;
591 use POSIX qw(locale_h);
594 setlocale (LC_ALL, '$loc');
596 eval "use Socket 1.7";
597 setlocale( LC_ALL, '$orig_loc');
602 eval "use lib '.'; use $package;";
603 unlike($warning, qr"Version string '1,7' contains invalid data",
604 'Handle locale action-at-a-distance');
607 eval 'my $v = $CLASS->$method("1._1");';
608 unlike($@, qr/^Invalid version format \(alpha with zero width\)/,
609 "Invalid version format 1._1");
613 local $SIG{__WARN__} = sub { $warning = $_[0] };
614 eval 'my $v = $CLASS->$method(~0);';
615 unlike($@, qr/Integer overflow in version/, "Too large version");
616 like($warning, qr/Integer overflow in version/, "Too large version");
620 # http://rt.cpan.org/Public/Bug/Display.html?id=30004
621 my $v1 = $CLASS->$method("v0.1_1");
622 (my $alpha1 = Dumper($v1)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms;
623 my $v2 = $CLASS->$method($v1);
624 (my $alpha2 = Dumper($v2)) =~ s/.+'alpha' => ([^,]+),.+/$1/ms;
625 is $alpha2, $alpha1, "Don't fall for Data::Dumper's tricks";
629 # http://rt.perl.org/rt3/Ticket/Display.html?id=56606
630 my $badv = bless { version => [1,2,3] }, "version";
631 is $badv, '1.002003', "Deal with badly serialized versions from YAML";
632 my $badv2 = bless { qv => 1, version => [1,2,3] }, "version";
633 is $badv2, 'v1.2.3', "Deal with badly serialized versions from YAML ";