Fix js & xml tests

This commit is contained in:
Clément Fournier
2022-02-14 00:02:59 +01:00
parent cc834b175e
commit c3aa845a6a
4 changed files with 49 additions and 41 deletions

View File

@ -4,14 +4,10 @@
package net.sourceforge.pmd.cli;
import static org.junit.Assert.assertTrue;
import java.io.File;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
import net.sourceforge.pmd.util.FileUtil;
/**
* @author Romain Pelisse <belaran@gmail.com>
*
@ -21,8 +17,7 @@ public class CLITest extends BaseCLITest {
public void useEcmaScript() {
String[] args = { "-d", SOURCE_FOLDER, "-f", "xml", "-R", "ecmascript-basic", "-version", "3", "-l",
"ecmascript", "-debug", };
String resultFilename = runTest(args);
assertTrue("Invalid JavaScript version",
FileUtil.findPatternInFile(new File(resultFilename), "Using Ecmascript version: Ecmascript 3"));
String log = runTest(args);
assertThat(log, containsPattern("Adding file .*\\.js \\(lang: ecmascript 3\\)"));
}
}