<commit_before>package net.zomis.calculator.model;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertEquals;

/**
 * Created by Simon on 4/23/2015.
 */
@RunWith(Parameterized.class)
public class CalcTest {

    private static final double DELTA = 0.00001;

    @Parameterized.Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][]{
                {"4", 4},
                {"4 + 9", 13},
                {"-4 + -4.2", -8.2},
                {"4 * 9", 36},
                {"2 + 7 * 3", 23},
                {"7 * 3 + 2", 23},
                {"7 - 3", 4},
                {"7 / 3", 2.3333333333},
                {"7 + 3 - 2 * 5 / 8 + 4 * 3 - 9", 7 + 3 - 2 * 5.0 / 8 + 4 * 3 - 9 },
                {"abs(-4)", 4},
                {"-5 * 2", -10},
                {"abs(-5 * 2)", 10},
                {"abs(abs(-42))", 42},
                {"abs(-abs(5 * 2))", 10},
                {"abs(-abs(-5 * 2))", 10},
        });
    }

    @Parameterized.Parameter(0)
    public String input;

    @Parameterized.Parameter(1)
    public double expected;

    @Test
    public void test() throws CalculationException {
        CalcContext context = CalcContext.createDefault();
        assertEquals(input, expected, context.createExpression(input).evaluate().getValue(), DELTA);
    }

}
<commit_msg>added more info when CalcTest fails with CalculationException<commit_after>package net.zomis.calculator.model;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import java.util.Arrays;
import java.util.Collection;

import static org.junit.Assert.assertEquals;

/**
 * Created by Simon on 4/23/2015.
 */
@RunWith(Parameterized.class)
public class CalcTest {

    private static final double DELTA = 0.00001;

    @Parameterized.Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][]{
                {"4", 4},
                {"4 + 9", 13},
                {"-4 + -4.2", -8.2},
                {"4 * 9", 36},
                {"2 + 7 * 3", 23},
                {"7 * 3 + 2", 23},
                {"7 - 3", 4},
                {"7 / 3", 2.3333333333},
                {"7 + 3 - 2 * 5 / 8 + 4 * 3 - 9", 7 + 3 - 2 * 5.0 / 8 + 4 * 3 - 9 },
                {"abs(-4)", 4},
                {"-5 * 2", -10},
                {"abs(-5 * 2)", 10},
                {"abs(abs(-42))", 42},
                {"abs(-abs(5 * 2))", 10},
                {"abs(-abs(-5 * 2))", 10},
        });
    }

    @Parameterized.Parameter(0)
    public String input;

    @Parameterized.Parameter(1)
    public double expected;

    @Test
    public void test() throws CalculationException {
        CalcContext context = CalcContext.createDefault();
        try {
            assertEquals(input, expected, context.createExpression(input).evaluate().getValue(), DELTA);
        } catch (CalculationException ex) {
            throw new RuntimeException(input, ex);
        }
    }

}

{'fraction_non_alphanumeric': 0.1623521891978268, 'fraction_numerical': 0.06072227548737616, 'mean_word_length': 1.7456140350877194, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4902906', 'n_tokens_mistral': 1123, 'n_tokens_neox': 940, 'n_words': 247}