Main { public static int mainLoop(String[] args, InputStream in, PrintStream out, PrintStream err) throws IOException { return mainLoop(args, in, out, err, null); }  @SuppressWarnings({"squid:S106"}) static void main(String[] args); static int mainLoop(String[] args, InputStream in, PrintStream out, PrintStream err); static int mainLoop(String[] args, InputStream in, PrintStream out, PrintStream err, Class<?> base_class); static Map<String,RegexRule> readRules(/*@ non_null @*/ String filename); static final String REGEX_FILENAME; static final String REGEX_FILENAME_DETEX; static final String VERSION_STRING; }
@Test(timeout = 1000) public void test1() throws IOException { Main.mainLoop(new String[] {"--help"}, null, new NullPrintStream(), new NullPrintStream()); }
@Test(timeout = 1000) public void test2() throws IOException { Main.mainLoop(new String[] {"--help", "--quiet"}, null, new NullPrintStream(), new NullPrintStream()); }
@Test(timeout = 1000) public void test3() throws IOException { Main.mainLoop(new String[] {"--help", "--quiet"}, null, new NullPrintStream(), new NullPrintStream()); }
@Test(timeout = 1000) public void test4() throws IOException { Main.mainLoop(new String[] {"--version"}, null, new NullPrintStream(), new NullPrintStream()); }
@Test public void test5() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertEquals(0, ret_code); }
@Test public void test5Html() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test-stacked-1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--output", "html", "--read-all"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertTrue(ret_code > 0); }
@Test(timeout = 2000) public void test6() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test-subsec-1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertTrue(ret_code > 0); }
@Test public void test7() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test-subsec-1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--ignore", "sh:seclen,sh:nsubdiv"}, in, out, new NullPrintStream()); assertEquals(0, ret_code); }
@Test(timeout = 20000) public void test8() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--read-all", "--check", "en"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertEquals(0, ret_code); }
@Test(timeout = 20000) public void test9() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--read-all", "--check", "en", "--languagemodel", "/tmp/foobarbaz"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertEquals(0, ret_code); }
@Test(timeout = 5000) public void testClean1() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--read-all", "--clean"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertEquals(0, ret_code); assertFalse(output.trim().isEmpty()); }
@Test(timeout = 5000) public void testClean2() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test1.md"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--clean", "--read-all", "--type", "md"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertEquals(0, ret_code); }
@Test(timeout = 5000) public void testClean3() throws IOException { InputStream in = MainTest.class.getResourceAsStream("rules/data/test1.tex"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--clean", "--read-all", "--remove", "itemize"}, in, out, new NullPrintStream()); String output = new String(baos.toByteArray()); assertNotNull(output); assertEquals(0, ret_code); assertTrue(output.trim().isEmpty()); }
@Test(timeout = 5000) public void testInput1() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); int ret_code = Main.mainLoop(new String[] {"--no-color", "--read-all", "rules/data/test-input1.tex"}, null, out, new NullPrintStream(), MainTest.class); String output = new String(baos.toByteArray()); assertNotNull(output); assertTrue(ret_code > 0); assertFalse(output.trim().isEmpty()); }
@Test(timeout = 5000) public void testNgrams1() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream out = new PrintStream(baos); Main.mainLoop(new String[] {"--check", "fr", "--languagemodel", ".", "--read-all", "rules/data/test-input1.tex"}, null, out, new NullPrintStream(), MainTest.class); String output = new String(baos.toByteArray()); assertNotNull(output); assertFalse(output.trim().isEmpty()); }