aboutsummaryrefslogtreecommitdiffstats
path: root/test/MainTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/MainTest.java')
-rw-r--r--test/MainTest.java53
1 files changed, 0 insertions, 53 deletions
diff --git a/test/MainTest.java b/test/MainTest.java
deleted file mode 100644
index f90e367..0000000
--- a/test/MainTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.jantuomi.interpreter.test;
-
-import com.jantuomi.interpreter.main.Main;
-import com.jantuomi.interpreter.main.exception.InterpreterException;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-/**
- * Created by jan on 10.6.2016.
- */
-public class MainTest {
-
- private final ByteArrayOutputStream out = new ByteArrayOutputStream();
- private PrintStream originalOut;
-
- @Before
- public void setupStreams() {
- originalOut = System.out;
- System.setOut(new PrintStream(out));
- }
-
- @After
- public void cleanStreams() {
- System.setOut(originalOut);
- }
-
- @Test
- public void testParseArguments1() {
- String[] notAnArgument = {"--not-an-argument"};
- assertFalse(Main.parseArguments(notAnArgument));
- }
-
- @Test
- public void testParseArguments2() {
- String[] fileTestArgument = {"-f", "test.file"};
- assertTrue(Main.parseArguments(fileTestArgument));
- }
-
- @Test
- public void testWholeProcedure() throws InterpreterException {
- String input = "- + 2 5 1";
-
- Main.run(input);
- assertTrue(out.toString().contains("6"));
- }
-} \ No newline at end of file