diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-12 16:44:03 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-02-12 16:44:03 +0000 |
commit | 4fb41b6cb72040b7cabcc2aa7260435ccfcdc2a2 (patch) | |
tree | 4acf55f1572e715af77266c67398542f2a13a655 /t | |
parent | 456e5c250574dfebfc7b848d9f6eea26e8193bc0 (diff) | |
parent | 6132ea6cb008000f686569237d7bd960bbd9703f (diff) | |
download | perl-4fb41b6cb72040b7cabcc2aa7260435ccfcdc2a2.tar.gz |
Integrate win32 into mainline
p4raw-id: //depot/perl@511
Diffstat (limited to 't')
-rwxr-xr-x | t/comp/require.t | 36 | ||||
-rwxr-xr-x | t/op/local.t | 12 |
2 files changed, 47 insertions, 1 deletions
diff --git a/t/comp/require.t b/t/comp/require.t new file mode 100755 index 0000000000..bae0712dfa --- /dev/null +++ b/t/comp/require.t @@ -0,0 +1,36 @@ +#!./perl + +BEGIN { + chdir 't' if -d 't'; + @INC = ('.'); +} + +# don't make this lexical +$i = 1; +print "1..3\n"; + +sub do_require { + %INC = (); + open(REQ,">bleah.pm") or die "Can't write 'bleah.pm': $!"; + print REQ @_; + close REQ; + eval { require "bleah.pm" }; + my @a; # magic guard for scope violations (must be first lexical in file) +} + +# run-time failure in require +do_require "0;\n"; +print "# $@\nnot " unless $@ =~ /did not return a true/; +print "ok ",$i++,"\n"; + +# compile-time failure in require +do_require "1)\n"; +print "# $@\nnot " unless $@ =~ /syntax error/; +print "ok ",$i++,"\n"; + +# successful require +do_require "1"; +print "# $@\nnot " if $@; +print "ok ",$i++,"\n"; + +unlink 'bleah.pm'; diff --git a/t/op/local.t b/t/op/local.t index 3e30306218..a034539cae 100755 --- a/t/op/local.t +++ b/t/op/local.t @@ -2,7 +2,7 @@ # $RCSfile: local.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:04 $ -print "1..24\n"; +print "1..25\n"; sub foo { local($a, $b) = @_; @@ -58,3 +58,13 @@ $a = 'outer'; if (1) { local $a = 'inner' } print +($a eq 'outer') ? "" : "not ", "ok 24\n"; +# see if localization works when scope unwinds + +local $m = 5; +eval { + for $m (6) { + local $m = 7; + die "bye"; + } +}; +print $m == 5 ? "" : "not ", "ok 25\n"; |