|
| 1 | +package cz.crcs.ectester.reader; |
| 2 | + |
| 3 | +import org.junit.jupiter.api.Disabled; |
| 4 | +import org.junit.jupiter.api.Test; |
| 5 | +import org.junitpioneer.jupiter.DisabledUntil; |
| 6 | +import org.junitpioneer.jupiter.StdIo; |
| 7 | +import org.junitpioneer.jupiter.StdOut; |
| 8 | + |
| 9 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
| 10 | + |
| 11 | +public class AppTests { |
| 12 | + |
| 13 | + @Test |
| 14 | + @StdIo() |
| 15 | + public void help(StdOut out) { |
| 16 | + ECTesterReader.main(new String[]{"-h"}); |
| 17 | + String s = out.capturedString(); |
| 18 | + assertTrue(s.contains("ECTesterReader")); |
| 19 | + } |
| 20 | + |
| 21 | + @Test |
| 22 | + @StdIo() |
| 23 | + public void listSuites(StdOut out) { |
| 24 | + ECTesterReader.main(new String[]{"--list-suites"}); |
| 25 | + String s = out.capturedString(); |
| 26 | + assertTrue(s.contains("default test suite")); |
| 27 | + } |
| 28 | + |
| 29 | + @Test |
| 30 | + @StdIo() |
| 31 | + public void listData(StdOut out) { |
| 32 | + ECTesterReader.main(new String[]{"--list-named"}); |
| 33 | + String s = out.capturedString(); |
| 34 | + assertTrue(s.contains("secg")); |
| 35 | + } |
| 36 | + |
| 37 | + // Add StdIo to all the suite tests when this is resolved: https://github.com/junit-pioneer/junit-pioneer/issues/822 |
| 38 | + |
| 39 | + @Test |
| 40 | + public void defaultSuite() { |
| 41 | + ECTesterReader.main(new String[]{"-t", "default", "-s"}); |
| 42 | + } |
| 43 | + |
| 44 | + @Test |
| 45 | + public void testVectorSuite() { |
| 46 | + ECTesterReader.main(new String[]{"-t", "test-vectors", "-s"}); |
| 47 | + } |
| 48 | + |
| 49 | + @Test |
| 50 | + public void compressionSuite() { |
| 51 | + ECTesterReader.main(new String[]{"-t", "compression", "-s"}); |
| 52 | + } |
| 53 | + |
| 54 | + @Test |
| 55 | + public void wrongSuite() { |
| 56 | + ECTesterReader.main(new String[]{"-t", "wrong", "-s", "-y"}); |
| 57 | + } |
| 58 | + |
| 59 | + @Test |
| 60 | + public void degenerateSuite() { |
| 61 | + ECTesterReader.main(new String[]{"-t", "degenerate", "-s", "-y"}); |
| 62 | + } |
| 63 | + |
| 64 | + @Test |
| 65 | + public void cofactorSuite() { |
| 66 | + ECTesterReader.main(new String[]{"-t", "cofactor", "-s", "-y"}); |
| 67 | + } |
| 68 | + |
| 69 | + @Test |
| 70 | + public void compositeSuite() { |
| 71 | + ECTesterReader.main(new String[]{"-t", "composite", "-s", "-y"}); |
| 72 | + } |
| 73 | + |
| 74 | + @Test |
| 75 | + public void invalidSuite() { |
| 76 | + ECTesterReader.main(new String[]{"-t", "invalid", "-s", "-y"}); |
| 77 | + } |
| 78 | + |
| 79 | + @Test |
| 80 | + public void edgeCasesSuite() { |
| 81 | + ECTesterReader.main(new String[]{"-t", "edge-cases", "-s", "-y"}); |
| 82 | + } |
| 83 | + |
| 84 | + @Test |
| 85 | + public void signatureSuite() { |
| 86 | + ECTesterReader.main(new String[]{"-t", "signature", "-s"}); |
| 87 | + } |
| 88 | + |
| 89 | + @Test |
| 90 | + public void twistSuite() { |
| 91 | + ECTesterReader.main(new String[]{"-t", "twist", "-s", "-y"}); |
| 92 | + } |
| 93 | + |
| 94 | + @Test |
| 95 | + public void miscellaneousSuite() { |
| 96 | + ECTesterReader.main(new String[]{"-t", "miscellaneous", "-s", "-y"}); |
| 97 | + } |
| 98 | +} |
0 commit comments