diff --git a/Examples/test-suite/perl5/default_args_runme.pl b/Examples/test-suite/perl5/default_args_runme.pl index 8d0d2689b..45f10b37e 100644 --- a/Examples/test-suite/perl5/default_args_runme.pl +++ b/Examples/test-suite/perl5/default_args_runme.pl @@ -41,11 +41,11 @@ ok(not($@), '%rename handling'); # exception specifications eval { default_args::exceptionspec() }; -is($@, "ciao", "exceptionspec 1"); +like($@, qr/^ciao/, "exceptionspec 1"); eval { default_args::exceptionspec(-1) }; -is($@, "ciao", "exceptionspec 2"); +like($@, qr/^ciao/, "exceptionspec 2"); eval { default_args::exceptionspec(100) }; -is($@, '100', "exceptionspec 3"); +like($@, qr/^100/, "exceptionspec 3"); my $ex = new default_args::Except($false); @@ -54,13 +54,13 @@ eval { $ex->exspec(); $hit = 1; }; # a zero was thrown, an exception occured, but $@ is false is($hit, 0, "exspec 1"); eval { $ex->exspec(-1) }; -is($@, "ciao", "exspec 2"); +like($@, qr/^ciao/, "exspec 2"); eval { $ex->exspec(100) }; -is($@, 100, "exspec 3"); +like($@, qr/^100/, "exspec 3"); eval { $ex = default_args::Except->new($true) }; -is($@, -1, "Except constructor 1"); +like($@, qr/-1/, "Except constructor 1"); eval { $ex = default_args::Except->new($true, -2) }; -is($@, -2, "Except constructor 2"); +like($@, qr/-2/, "Except constructor 2"); #Default parameters in static class methods is(default_args::Statics::staticmethod(), 60, "staticmethod 1"); diff --git a/Examples/test-suite/perl5/li_std_string_runme.pl b/Examples/test-suite/perl5/li_std_string_runme.pl index 9ec7dd08c..e6358ff1f 100644 --- a/Examples/test-suite/perl5/li_std_string_runme.pl +++ b/Examples/test-suite/perl5/li_std_string_runme.pl @@ -48,7 +48,7 @@ li_std_string::test_reference($stringPtr); # Check throw exception specification eval { li_std_string::test_throw() }; -is($@, "test_throw message", "Test 5"); +like($@, qr/^test_throw message/, "Test 5"); { local $TODO = "why is the error not a Perl string?"; eval { li_std_string::test_const_reference_throw() }; is($@, "", "Test 6");