forked from phoedos/pmd
pmd: add changelog and test for #1144
This commit is contained in:
parent
678d3e8a1b
commit
973fd1c4d4
@ -1,3 +1,8 @@
|
||||
????? - 5.0.6:
|
||||
|
||||
Fixed bug 1144: CPD encoding argument has no effect
|
||||
|
||||
|
||||
August 11, 2013 - 5.0.5:
|
||||
|
||||
Fixed bug 991: AvoidSynchronizedAtMethodLevel for static methods
|
||||
|
@ -44,6 +44,29 @@ public class CPDCommandLineInterfaceTest {
|
||||
Assert.assertTrue(out.contains("Found a 7 line (34 tokens) duplication"));
|
||||
}
|
||||
|
||||
/**
|
||||
* #1144 CPD encoding argument has no effect
|
||||
*/
|
||||
@Test
|
||||
public void testEncodingOption() throws Exception {
|
||||
String origEncoding = System.getProperty("file.encoding");
|
||||
|
||||
// set the default encoding under Windows
|
||||
System.setProperty("file.encoding", "Cp1252");
|
||||
|
||||
runCPD("--minimum-tokens", "34", "--language", "java",
|
||||
"--files", "src/test/resources/net/sourceforge/pmd/cpd/clitest/",
|
||||
"--ignore-identifiers",
|
||||
"--format", "xml",
|
||||
// request UTF-8 for CPD
|
||||
"--encoding", "UTF-8");
|
||||
// reset default encoding
|
||||
System.setProperty("file.encoding", origEncoding);
|
||||
|
||||
String out = buffer.toString("UTF-8");
|
||||
Assert.assertTrue(out.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
|
||||
}
|
||||
|
||||
private void runCPD(String... args) {
|
||||
CPD.dontExitForTests = true;
|
||||
CPD.main(args);
|
||||
|
Loading…
x
Reference in New Issue
Block a user