summaryrefslogtreecommitdiff
path: root/clformat/src/test/java/bjc/utils
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2019-07-26 17:38:12 -0300
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2019-07-26 17:38:12 -0300
commitd317469f2063e7e57f97df9381d23a94bbc43bb0 (patch)
treeeaf0adb827ed3d9265154f722355c817e8896923 /clformat/src/test/java/bjc/utils
parent58ba68ad475074311a8921067ea04feb6f22588d (diff)
Refactor directive handling
Refactored the tokenizer to pass back tokens which have the data stored on them, significantly cutting down on the amount of parsing/reparsing of directives we are doing. Also, it makes the over-arching goal of allowing compilation easier
Diffstat (limited to 'clformat/src/test/java/bjc/utils')
-rw-r--r--clformat/src/test/java/bjc/utils/test/ioutils/CLTokenizerTest.java47
1 files changed, 0 insertions, 47 deletions
diff --git a/clformat/src/test/java/bjc/utils/test/ioutils/CLTokenizerTest.java b/clformat/src/test/java/bjc/utils/test/ioutils/CLTokenizerTest.java
deleted file mode 100644
index a66ffe1..0000000
--- a/clformat/src/test/java/bjc/utils/test/ioutils/CLTokenizerTest.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package bjc.utils.test.ioutils;
-
-import java.io.IOException;
-import java.util.Iterator;
-
-import org.junit.Test;
-
-import bjc.utils.ioutils.format.CLTokenizer;
-
-// Static imports
-
-import static java.util.Arrays.asList;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * Tests for CL format strings.
- *
- * @author EVE
- *
- */
-@SuppressWarnings("javadoc")
-public class CLTokenizerTest {
- @Test
- public void testTokenizer() {
- assertIteratorEquals(tokenize(""), "");
- assertIteratorEquals(tokenize("hello"), "hello");
- assertIteratorEquals(tokenize("hello olleh"), "hello olleh");
- assertIteratorEquals(tokenize("A ~A"), "A ", "~A");
-
- assertIteratorEquals(tokenize("~3,'0D"), "~3,'0D");
- assertIteratorEquals(tokenize("~,,'|,2:D"), "~,,'|,2:D");
- assertIteratorEquals(tokenize("~3,,,' ,2:R"), "~3,,,' ,2:R");
-
- assertIteratorEquals(tokenize("~@[print level = ~D~]~@[print length = ~D~]"), "~@[", "print level = ", "~D", "~]", "~@[", "print length = ", "~D", "~]");
- }
-
- private static Iterator<String> tokenize(String inp) {
- return new CLTokenizer(inp);
- }
-
- private static <T> void assertIteratorEquals(Iterator<T> src, T... vals) {
- for (T val : vals) {
- assertEquals(val, src.next());
- }
- }
-}