From d317469f2063e7e57f97df9381d23a94bbc43bb0 Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Fri, 26 Jul 2019 17:38:12 -0300 Subject: 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 --- .../bjc/utils/test/ioutils/CLTokenizerTest.java | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 clformat/src/test/java/bjc/utils/test/ioutils/CLTokenizerTest.java (limited to 'clformat/src/test/java') 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 tokenize(String inp) { - return new CLTokenizer(inp); - } - - private static void assertIteratorEquals(Iterator src, T... vals) { - for (T val : vals) { - assertEquals(val, src.next()); - } - } -} -- cgit v1.2.3