aboutsummaryrefslogtreecommitdiffstats
path: root/test/MainTest.java
blob: d6171a5a760a35e0574d8ba25744439bf9548843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.jantuomi.interpreter.test;

import com.jantuomi.interpreter.main.Main;
import com.jantuomi.interpreter.main.exception.InterpreterException;
import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * Created by jan on 10.6.2016.
 */
public class MainTest {
    @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 = "x <- 1 + 2";
        Main.run(input);
    }
}