<commit_before>package test;

import static org.junit.Assert.*;
import java.util.Collection;
import interpreter.Parser;
import interpreter.expression.SLogoExpression;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import exceptions.SLogoParsingException;

public class ParserTester {
    @Rule
    public ExpectedException exception = ExpectedException.none();
    @Test
    public void parseExceptionTest() {
        exception.expect(SLogoParsingException.class);
        Parser p = new Parser();
        String input = "forward 50 50";
        try {
            Collection<SLogoExpression> expression = p.parseSLogoExpression(input);
        }
        catch (SLogoParsingException e) {
            fail(exception.toString());
        }
    }

    @Test
    public void singleCommandParseTest() {
        exception.expect(SLogoParsingException.class);
        Parser p = new Parser();
        String input = "forward 50";
        try {
            Collection<SLogoExpression> expressions = p.parseSLogoExpression(input);
            assertEquals(expressions.size(),1);
        }
        catch (SLogoParsingException e) {
            fail(exception.toString());
        }
    }
    @Test
    public void twoCommandParseTest() {
        exception.expect(SLogoParsingException.class);
        Parser p = new Parser();
        String input = "forward 50 forward 50";
        try {
            Collection<SLogoExpression> expressions = p.parseSLogoExpression(input);
            assertEquals(expressions.size(),2);
        }
        catch (SLogoParsingException e) {
            fail(exception.toString());
        }
    }
}<commit_msg>JUnit last commit.<commit_after>package test;

import static org.junit.Assert.*;
import java.util.Collection;
import interpreter.Parser;
import interpreter.expression.SLogoExpression;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import exceptions.SLogoParsingException;

public class ParserTester {
    @Test
    public void parseExceptionTest() {
        Parser p = new Parser();
        String input = "forward 50 50";
        try {
            Collection<SLogoExpression> expression = p.parseSLogoExpression(input);
            fail("Did not throw Exception");
        }
        catch (SLogoParsingException e) {
            assertTrue(e instanceof SLogoParsingException);
        }
    }

    @Test
    public void singleCommandParseTest() {
        Parser p = new Parser();
        String input = "forward 50";
        try {
            Collection<SLogoExpression> expressions = p.parseSLogoExpression(input);
            assertEquals(expressions.size(),1);
        }
        catch (SLogoParsingException e) {
            fail(e.toString());
        }
    }
    @Test
    public void twoCommandParseTest() {
        Parser p = new Parser();
        String input = "forward 50 forward 50";
        try {
            Collection<SLogoExpression> expressions = p.parseSLogoExpression(input);
            assertEquals(expressions.size(),2);
        }
        catch (SLogoParsingException e) {
            fail(e.toString());
        }
    }
}
{'fraction_non_alphanumeric': 0.09689677010766308, 'fraction_numerical': 0.007599746675110829, 'mean_word_length': 2.49060773480663, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2330719', 'n_tokens_mistral': 873, 'n_tokens_neox': 840, 'n_words': 190}