Skip to content

Commit

Permalink
Item13897: Fixed a bug affecting test_roundtrip.
Browse files Browse the repository at this point in the history
It seems that whenever there is an attachment defined in resourse
Foswiki::Address.pm requires that the attachment has a name. The name is
expected to be in the second element of tompath array (tompath->[1]). But
test data for test_roundtrip containted a line defining an arrayref with
single 'attachment' string element which is not considered valid. Not when
DEBUG is set true at least. That line has been removed, AddressTests now
succeeds completely.
  • Loading branch information
vrurg authored and gac410 committed Jan 14, 2016
1 parent c502e89 commit 36ab951
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion UnitTestContrib/test/unit/AddressTests.pm
Expand Up @@ -32,7 +32,6 @@ my %test_roundtrip_range = (
],
tompaths => [
undef,
['attachment'],
[ 'attachment', 'Attachment' ],
[ 'attachment', 'Attach.ent' ],
[ 'attachment', 'Atta.h.ent' ],
Expand Down
4 changes: 2 additions & 2 deletions core/lib/Foswiki/Address.pm
Expand Up @@ -1448,8 +1448,8 @@ sub isValid {
and scalar( @{ $this->{tompath} } ) )
if DEBUG;
ASSERT(
not( $this->{topmath}->[0]
and $this->{topmath}->[0] eq 'attachment' )
not( $this->{tompath}->[0]
and $this->{tompath}->[0] eq 'attachment' )
) if DEBUG;
ASSERT( $pathtypes{ $this->{tompath}->[0] } ) if DEBUG;
$this->{type} =
Expand Down

0 comments on commit 36ab951

Please sign in to comment.