New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of dies_ok and lives_ok in Test.pm #108
Labels
Comments
From @bacekHello. There is implementation of dies_ok and lives_ok. -- |
From @bacekdies.diffdiff --git a/languages/perl6/Test.pm b/languages/perl6/Test.pm
index d09234f..52bc15e 100644
--- a/languages/perl6/Test.pm
+++ b/languages/perl6/Test.pm
@@ -102,6 +102,26 @@ multi sub flunk($reason) { proclaim(0, "flunk $reason")}
sub isa_ok($var,$type) { ok($var.isa($type), "The object is-a '$type'"); }
+multi sub dies_ok($closure, $reason) {
+ try {
+ $closure();
+ }
+ proclaim((defined $!), $reason);
+}
+multi sub dies_ok($closure) {
+ dies_ok($closure, '');
+}
+multi sub lives_ok($closure, $reason) {
+ try {
+ $closure();
+ }
+ proclaim((not defined $!), $reason);
+}
+multi sub lives_ok($closure) {
+ lives_ok($closure, '');
+}
+
+
## 'private' subs
sub proclaim($cond, $desc) {
|
From @pmichaud
Applied in r27825, thanks! Pm |
The RT System itself - Status changed from 'new' to 'open' |
From @pmichaudApplied in r27825, thanks! Pm |
@pmichaud - Status changed from 'open' to 'resolved' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migrated from rt.perl.org#54826 (status was 'resolved')
Searchable as RT54826$
The text was updated successfully, but these errors were encountered: