Skip to content

Commit 0f1e8c3

Browse files
committed
Refactor comoon code. URLCodec test coverage now 100%/100%.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@797671 13f79535-47bb-0310-9956-ffa450edef68
1 parent 71191d3 commit 0f1e8c3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/test/org/apache/commons/codec/net/URLCodecTest.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,21 @@ public void testDecodeInvalid() throws Exception {
138138
fail("DecoderException should have been thrown");
139139
} catch (DecoderException e) {
140140
// Expected. Move on
141-
}
141+
}
142142
try {
143+
// Bad 1st char after %
143144
urlCodec.decode("%WW");
144145
fail("DecoderException should have been thrown");
145146
} catch (DecoderException e) {
146147
// Expected. Move on
147148
}
149+
try {
150+
// Bad 2nd char after %
151+
urlCodec.decode("%0W");
152+
fail("DecoderException should have been thrown");
153+
} catch (DecoderException e) {
154+
// Expected. Move on
155+
}
148156
this.validateState(urlCodec);
149157
}
150158

0 commit comments

Comments
 (0)