<commit_before>package com.saraighatsoftware.flexicalculator;

import android.util.Log;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.util.Arrays;
import java.util.Vector;

import static org.junit.Assert.assertEquals;

@RunWith(PowerMockRunner.class)
@PrepareForTest({Log.class})
public class CalculatorTest {

    @Test
    public void Evaluate() throws Exception {
        PowerMockito.mockStatic(Log.class); // returns 1 when Log.e() etc is called
        Calculator mCalculator = new Calculator();

        // expected result vs input pairs
        Vector<Pair<String, String>> tests = new Vector<>();
        tests.add(new Pair<>("4", "2 + 2"));
        tests.add(new Pair<>("9", "5 + 2 * 2"));
        tests.add(new Pair<>("5", "5 / 2 * 2"));
        tests.add(new Pair<>("2", "( 2 )"));
        tests.add(new Pair<>("1.25", "5 / ( 2 * 2 )"));
        tests.add(new Pair<>("4", "( 2 * 2 )"));
        tests.add(new Pair<>("12", "5 + ( 2 * 2 + 4 - 1 )"));
        tests.add(new Pair<>("15", "5 + ( 2 * ( 2 + 4 - 1 ) )"));
        tests.add(new Pair<>("35", "5 + ( 2 * ( 2 + 4 - 1 ) ) * ( 2 + 1 )"));
        tests.add(new Pair<>("35", "( 2 * ( 2 + 4 - 1 ) ) * ( 2 + 1 ) + 5"));
        tests.add(new Pair<>("3.142857", "( 22 / 7 )"));
        tests.add(new Pair<>("4.714286", "( 33 / 7 )"));
        tests.add(new Pair<>("1.1", ".1 + 1"));
        tests.add(new Pair<>("1.1", "1 + .1"));
        tests.add(new Pair<>("1.1", "0.1 + 1"));
        tests.add(new Pair<>("1.1", "1 + 0.1"));
        tests.add(new Pair<>("2", "4 - 2"));
        tests.add(new Pair<>("4", "2 - - 2"));

        for (Pair<String, String> test : tests) {<commit_msg>Fix test<commit_after>package com.saraighatsoftware.flexicalculator;

import android.util.Log;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;

import java.util.Arrays;
import java.util.Vector;

import static org.junit.Assert.assertEquals;

@RunWith(PowerMockRunner.class)
@PrepareForTest({Log.class})
public class CalculatorTest {

    @Test
    public void Evaluate() throws Exception {
        PowerMockito.mockStatic(Log.class); // returns 1 when Log.e() etc is called
        Calculator mCalculator = new Calculator();

        // expected result vs input pairs
        Vector<Pair<String, String>> tests = new Vector<>();
        tests.add(new Pair<>("4", "2 + 2"));
        tests.add(new Pair<>("9", "5 + 2 * 2"));
        tests.add(new Pair<>("5", "5 / 2 * 2"));
        tests.add(new Pair<>("2", "( 2 )"));
        tests.add(new Pair<>("1.25", "5 / ( 2 * 2 )"));
        tests.add(new Pair<>("4", "( 2 * 2 )"));
        tests.add(new Pair<>("12", "5 + ( 2 * 2 + 4 - 1 )"));
        tests.add(new Pair<>("15", "5 + ( 2 * ( 2 + 4 - 1 ) )"));
        tests.add(new Pair<>("35", "5 + ( 2 * ( 2 + 4 - 1 ) ) * ( 2 + 1 )"));
        tests.add(new Pair<>("35", "( 2 * ( 2 + 4 - 1 ) ) * ( 2 + 1 ) + 5"));
        tests.add(new Pair<>("3.142857", "( 22 / 7 )"));
        tests.add(new Pair<>("4.714286", "( 33 / 7 )"));
        tests.add(new Pair<>("1.1", ".1 + 1"));
        tests.add(new Pair<>("1.1", "1 + .1"));
        tests.add(new Pair<>("1.1", "0.1 + 1"));
        tests.add(new Pair<>("1.1", "1 + 0.1"));
        tests.add(new Pair<>("2", "4 - 2"));
        tests.add(new Pair<>("4", "2 - ( -2 )"));

        for (Pair<String, String> test : tests) {
{'fraction_non_alphanumeric': 0.21919302071973829, 'fraction_numerical': 0.05452562704471101, 'mean_word_length': 2.6653346653346652, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4443863', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1283, 'n_words': 299}