use of module.LongTest in project solution-finder by knewjade.
the class PathCountCaseTest method pattern6.
@Test
@LongTest
void pattern6() throws Exception {
/*
__________
__________
__________
__________
*/
String tetfu = "v115@vhAAgH";
String command = String.format("path -p J,Z,O,S,L,I,I,J,S,O,Z -t %s", tetfu);
Log log = RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
System.out.println(log.getOutput());
assertThat(log.getReturnCode()).isEqualTo(0);
assertThat(log.getOutput()).contains("J,Z,O,S,L,I,I,J,S,O,Z").contains(Messages.uniqueCount(71)).contains(Messages.minimalCount(1)).contains(Messages.useHold());
}
use of module.LongTest in project solution-finder by knewjade.
the class PathRandomFileCaseTest method hold1.
@ParameterizedTest
@ArgumentsSource(Hold1TestCase.class)
@LongTest
void hold1(String command, int unique) throws Exception {
Log log = RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
assertThat(log.getOutput()).contains(Messages.useHold()).contains(Messages.uniqueCount(unique));
}
use of module.LongTest in project solution-finder by knewjade.
the class PathRandomFileCaseTest method hold2.
@ParameterizedTest
@ArgumentsSource(Hold2TestCase.class)
@LongTest
void hold2(String command, int unique) throws Exception {
Log log = RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
assertThat(log.getOutput()).contains(Messages.useHold()).contains(Messages.uniqueCount(unique));
}
use of module.LongTest in project solution-finder by knewjade.
the class PathRandomPatternFileCasesTest method reserved.
@ParameterizedTest
@ArgumentsSource(ReservedTestCase.class)
@LongTest
void reserved(String command, int unique, int success, int all) throws Exception {
Log log = RunnerHelper.runnerCatchingLog(() -> EntryPointMain.main(command.split(" ")));
assertThat(log.getOutput()).contains(Messages.pathCount(unique)).contains(Messages.success(success, all));
}
use of module.LongTest in project solution-finder by knewjade.
the class PermutationIterableTest method iteratorRandomBlock.
@Test
@LongTest
void iteratorRandomBlock() throws Exception {
Randoms randoms = new Randoms();
ArrayList<Piece> allPieces = Lists.newArrayList(Iterables.concat(Piece.valueList(), Piece.valueList()));
for (int pop = 1; pop <= 7; pop++) {
PermutationIterable<Piece> iterable = new PermutationIterable<>(allPieces, pop);
HashSet<LongPieces> sets = StreamSupport.stream(iterable.spliterator(), false).map(Collection::stream).map(LongPieces::new).collect(Collectors.toCollection(HashSet::new));
// ランダムにサンプルを選択し、必ず列挙したセットの中にあることを確認
for (int count = 0; count < 1000; count++) {
List<Piece> sample = randoms.sample(allPieces, pop);
LongPieces pieces = new LongPieces(sample);
assertThat(pieces).isIn(sets);
}
}
}
Aggregations