Permalink
Browse files

really basic tests

  • Loading branch information...
1 parent 404b579 commit 2ded06a4a56f1c2218eb5cd0b9d7c0d25b2be153 @rjbs committed Oct 24, 2010
Showing with 35 additions and 0 deletions.
  1. +35 −0 t/basic.t
View
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+use Test::More tests => 4;
+use Test::Fatal qw(exception success);
+use Try::Tiny 0.07;
+
+like(
+ exception { die "foo bar" },
+ qr{foo bar},
+ "foo bar is like foo bar",
+);
+
+ok(
+ ! exception { 1 },
+ "no fatality means no exception",
+);
+
+# TODO: test for fatality of undef exception
+# TODO: test for fatality of false exception
+
+try {
+ die "die";
+} catch {
+ pass("we die on demand");
+} success {
+ fail("this should never be emitted");
+};
+
+try {
+ # die "die";
+} catch {
+ fail("we did not demand to die");
+} success {
+ pass("a success block runs, passing");
+};

0 comments on commit 2ded06a

Please sign in to comment.