ExceptionTests.pm
wants to verify the wrong thing.
In
test_simpleOopsException
and
test_multiparamOopsException
it expects the template to be returned from the exception as they provide, but alas:
Expected:'templatename'
But got:'oopstemplatename'
This is immediately obvious when looking at line 78 of
OopsException.pm
:
$template = 'oops' . $template if ( $template !~ /^oops/ );
So the test cases need to be fixed.
--
TWiki:Main/HaraldJoerg
- 2014-06-22
Patch:
Index: ExceptionTests.pm
===================================================================
--- ExceptionTests.pm (revision 27670)
+++ ExceptionTests.pm (working copy)
@@ -25,10 +25,10 @@
$this->assert_str_equals('topicname', $e->{topic});
$this->assert_str_equals('defname', $e->{def});
$this->assert_equals(1, $e->{keep});
- $this->assert_str_equals('templatename', $e->{template});
+ $this->assert_str_equals('oopstemplatename', $e->{template});
$this->assert_str_equals(
'phlegm', join(',', @{$e->{params}}));
- $this->assert_str_equals('OopsException(templatename/defname web=>webname topic=>topicname keep=>1 params=>[phlegm])', $e->stringify());
+ $this->assert_str_equals('OopsException(oopstemplatename/defname web=>webname topic=>topicname keep=>1 params=>[phlegm])', $e->stringify());
};
}
@@ -46,10 +46,10 @@
$this->assert($e->isa('TWiki::OopsException'));
$this->assert_str_equals('webname', $e->{web});
$this->assert_str_equals('topicname', $e->{topic});
- $this->assert_str_equals('templatename', $e->{template});
+ $this->assert_str_equals('oopstemplatename', $e->{template});
$this->assert_str_equals(
'phlegm,<pus>', join(',', @{$e->{params}}));
- $this->assert_str_equals('OopsException(templatename web=>webname topic=>topicname params=>[phlegm,<pus>])', $e->stringify());
+ $this->assert_str_equals('OopsException(oopstemplatename web=>webname topic=>topicname params=>[phlegm,<pus>])', $e->stringify());
};
}
--
TWiki:Main.HaraldJoerg
- 2014-06-23
Committed under
Item7535, together with the same bug in two other unit tests, so closing this one as duplicate.
--
TWiki:Main.HaraldJoerg
- 2014-07-18