diff options
-rwxr-xr-x | t/comp/require.t | 20 | ||||
-rwxr-xr-x | t/comp/use.t | 8 | ||||
-rw-r--r-- | toke.c | 2 |
3 files changed, 27 insertions, 3 deletions
diff --git a/t/comp/require.t b/t/comp/require.t index d4c9d8ca61..f963a8ce30 100755 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -7,7 +7,7 @@ BEGIN { # don't make this lexical $i = 1; -print "1..16\n"; +print "1..20\n"; sub do_require { %INC = (); @@ -23,6 +23,24 @@ sub write_file { close REQ; } +eval {require 5.005}; +print "# $@\nnot " if $@; +print "ok ",$i++,"\n"; + +eval { require 5.005 }; +print "# $@\nnot " if $@; +print "ok ",$i++,"\n"; + +eval { require 5.005; }; +print "# $@\nnot " if $@; +print "ok ",$i++,"\n"; + +eval { + require 5.005 +}; +print "# $@\nnot " if $@; +print "ok ",$i++,"\n"; + # new style version numbers eval { require v5.5.630; }; diff --git a/t/comp/use.t b/t/comp/use.t index 2594f0a547..dbbda5c038 100755 --- a/t/comp/use.t +++ b/t/comp/use.t @@ -5,9 +5,15 @@ BEGIN { unshift @INC, '../lib'; } -print "1..14\n"; +print "1..15\n"; my $i = 1; +eval "use 5.000"; # implicit semicolon +if ($@) { + print STDERR $@,"\n"; + print "not "; +} +print "ok ",$i++,"\n"; eval "use 5.000;"; if ($@) { @@ -825,7 +825,7 @@ S_force_version(pTHX_ char *s) if (*d == 'v') d++; for (; isDIGIT(*d) || *d == '_' || *d == '.'; d++); - if ((*d == ';' || isSPACE(*d)) && *(skipspace(d)) != ',') { + if (*d == ';' || isSPACE(*d) || *d == '}' || !*d) { s = scan_num(s); /* real VERSION number -- GBARR */ version = yylval.opval; |