summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorchromatic <chromatic@wgz.org>2008-05-10 05:52:11 -0700
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-05-18 21:08:01 +0000
commitbe25f60935927114e0ef411fb4fbc04fea5ce8fa (patch)
tree3ec48b054b9f6867ea11fb40e75da767d5bbaa25 /t
parente385c3bfc8853b925197cc2ddff78a11bae595e5 (diff)
downloadperl-be25f60935927114e0ef411fb4fbc04fea5ce8fa.tar.gz
Add ..., !!!, and ??? operators
Message-Id: <200805101252.11961.chromatic@wgz.org> p4raw-id: //depot/perl@33858
Diffstat (limited to 't')
-rw-r--r--t/op/yadayada.t45
1 files changed, 45 insertions, 0 deletions
diff --git a/t/op/yadayada.t b/t/op/yadayada.t
new file mode 100644
index 0000000000..9f9e903730
--- /dev/null
+++ b/t/op/yadayada.t
@@ -0,0 +1,45 @@
+#!./perl
+
+print "1..5\n";
+
+$err = "Unimplemented at $0 line " . ( __LINE__ + 2 ) . ".\n";
+
+eval { ... };
+
+print "not " unless $@ eq $err;
+print "ok 1\n";
+print "# expected: '$err'\n# received: '$@'\n" unless $@ eq $err;
+
+$err = "foo at $0 line " . ( __LINE__ + 2 ) . ".\n";
+
+eval { !!! "foo" };
+
+print "not " unless $@ eq $err;
+print "ok 2\n";
+print "# expected: '$err'\n# received: '$@'\n" unless $@ eq $err;
+
+$err = "Died at $0 line " . ( __LINE__ + 2 ) . ".\n";
+
+eval { !!! };
+
+print "not " unless $@ eq $err;
+print "ok 3\n";
+print "# expected: '$err'\n# received: '$@'\n" unless $@ eq $err;
+
+local $SIG{__WARN__} = sub { $warning = shift };
+
+$err = "bar at $0 line " . ( __LINE__ + 2 ) . ".\n";
+
+eval { ??? "bar" };
+
+print "not " unless $warning eq $err;
+print "ok 4\n";
+print "# expected: '$warning'\n# received: '$warningn" unless $warning eq $err;
+
+$err = "Warning: something's wrong at $0 line " . ( __LINE__ + 2 ) . ".\n";
+
+eval { ??? };
+
+print "not " unless $warning eq $err;
+print "ok 5\n";
+print "# expected: '$warning'\n# received: '$warningn" unless $warning eq $err;