Gather data
This commit is contained in:
26
src/test/java/puzzle/TestSort.java
Normal file
26
src/test/java/puzzle/TestSort.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package puzzle;
|
||||
import puzzle.ThemePoolBuilderLength.Lexicon;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
public class TestSort {
|
||||
public static void main(String[] args) throws Exception {
|
||||
Lexicon lex = new Lexicon(
|
||||
Arrays.asList("A", "B", "C"),
|
||||
new HashMap<>(),
|
||||
new int[]{10, 30, 20},
|
||||
new BitSet[9]
|
||||
);
|
||||
BitSet bs = new BitSet();
|
||||
bs.set(0); bs.set(1); bs.set(2);
|
||||
Path p = Paths.get("test_pool.txt");
|
||||
ThemePoolBuilderLength.writeWordList(p, lex, bs);
|
||||
List<String> lines = Files.readAllLines(p);
|
||||
System.out.println("Sorted words: " + lines);
|
||||
if (lines.get(0).equals("B") && lines.get(1).equals("C") && lines.get(2).equals("A")) {
|
||||
System.out.println("SUCCESS");
|
||||
} else {
|
||||
System.out.println("FAILURE");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user