Skip to content
Browse files

Catch exceptions in yaml_ok.

  • Loading branch information...
1 parent 73514c8 commit a15d3abdbb67045e03192ed50dff3233d7627559 @bacek bacek committed Jan 29, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 t/lib/Test.pm
View
10 t/lib/Test.pm
@@ -3,8 +3,14 @@
our sub yaml_ok($yaml, $expected, $description, *%adverbs) {
my $parser := YAML::Tiny.new;
- my $result := $parser.read_string($yaml);
- is_deeply($expected, $result, $description, todo => %adverbs<todo>);
+ try {
+ my $result := $parser.read_string($yaml);
+ is_deeply($expected, $result, $description, todo => %adverbs<todo>);
+
+ CATCH {
+ nok(1, "Parse failed '{ $! }'");
+ }
+ }
}
Q:PIR {

0 comments on commit a15d3ab

Please sign in to comment.
Something went wrong with that request. Please try again.