aboutsummaryrefslogtreecommitdiffstats
path: root/test/core
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2016-06-28 21:09:43 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2016-07-26 19:47:12 +0300
commit8f84c00978dc05007873a9fe1de6a18511dc3cf8 (patch)
tree39fead540e22addee40b95b68db08cbea620745b /test/core
parent48dcd488054024d98fe1e659a4029630130d1d35 (diff)
Restructure project for use with maven
Diffstat (limited to 'test/core')
-rw-r--r--test/core/CommandLineArgumentContainerTest.java26
-rw-r--r--test/core/parser/ParserTest.java31
-rw-r--r--test/core/tokenizer/TokenizerTest.java27
3 files changed, 0 insertions, 84 deletions
diff --git a/test/core/CommandLineArgumentContainerTest.java b/test/core/CommandLineArgumentContainerTest.java
deleted file mode 100644
index f6a6ead..0000000
--- a/test/core/CommandLineArgumentContainerTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.jantuomi.interpreter.test.core;
-
-import com.jantuomi.interpreter.main.core.CommandLineArgumentContainer;
-import com.jantuomi.interpreter.main.utils.Utilities;
-import org.junit.Test;
-
-import java.io.File;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * Created by jan on 10.6.2016.
- */
-public class CommandLineArgumentContainerTest {
- @Test
- public void getSourceFileContents() throws Exception {
- CommandLineArgumentContainer c = CommandLineArgumentContainer.getInstance();
-
- File basePath = new File(Utilities.getBasePath());
- c.setFile(new File(basePath, "src/com/jantuomi/interpreter/test/resources/test.file"));
- String contents = c.getSourceFileContents();
- System.out.println(contents);
- assertTrue(contents.contains("###"));
- }
-
-} \ No newline at end of file
diff --git a/test/core/parser/ParserTest.java b/test/core/parser/ParserTest.java
deleted file mode 100644
index 9dc51e3..0000000
--- a/test/core/parser/ParserTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.jantuomi.interpreter.test.core.parser;
-
-import com.jantuomi.interpreter.main.core.parser.Parser;
-import com.jantuomi.interpreter.main.core.tokenizer.token.Token;
-import com.jantuomi.interpreter.main.core.tokenizer.token.types.AdditionToken;
-import com.jantuomi.interpreter.main.core.tokenizer.token.types.IntegerLiteralToken;
-import org.junit.Test;
-
-import java.util.Arrays;
-import java.util.List;
-
-/**
- * Created by jan on 12.6.2016.
- */
-public class ParserTest {
-
- @Test
- public void testParseAddition() throws Exception {
- List<Token> tokens = Arrays.asList(
- new IntegerLiteralToken("1"),
- new IntegerLiteralToken("2"),
- new AdditionToken()
- );
-
- Parser parser = Parser.getInstance();
- List<Token> sequence = parser.parse(tokens);
- for (Token t : sequence) {
- parser.printTree(t);
- }
- }
-} \ No newline at end of file
diff --git a/test/core/tokenizer/TokenizerTest.java b/test/core/tokenizer/TokenizerTest.java
deleted file mode 100644
index 4274a93..0000000
--- a/test/core/tokenizer/TokenizerTest.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.jantuomi.interpreter.test.core.tokenizer;
-
-import com.jantuomi.interpreter.main.core.tokenizer.Tokenizer;
-import com.jantuomi.interpreter.main.core.tokenizer.token.Token;
-import com.jantuomi.interpreter.main.core.tokenizer.token.types.IntegerLiteralToken;
-import com.jantuomi.interpreter.main.exception.InterpreterException;
-import org.junit.Test;
-
-import java.util.List;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * Created by jan on 10.6.2016.
- */
-public class TokenizerTest {
-
- @Test
- public void testAddition() throws InterpreterException {
- String testString = "1 2 +";
- List<Token> list = Tokenizer.getInstance().tokenize(testString);
-
- System.out.println(String.format("test string:\n%s", testString));
- Tokenizer.printTokens(list);
- assertTrue(list.contains(new IntegerLiteralToken("2")));
- }
-} \ No newline at end of file