<commit_before>package com.lamaVersion.impl

import org.scalatest.FunSuite
import EasyIO._

class EasyIOTest extends FunSuite {

    val parser = ArgOps("someInt" -> 4, "someFlag", "someWord" -> "hello")

    test("the ArgOps parser rejects unknow options") {
        intercept[UnknownOption](parser <<| Array("-nothing"))
    }

    test("the ArgOps parser rejects options without args"){
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someInt","-someFlag"))
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someWord", "-someFlag"))
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someInt"))
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someWord"))
    }
    
    test("the ArgOps parser reads the correct values"){
        val argOps1 = parser <<| Array("-someInt", "3", "-someFlag", "-someWord", "goodbye")
        assert(argOps1("someInt").asInt == 3)
        assert(argOps1("someFlag").asBoolean == true)
        assert(argOps1("someWord").asString == "goodbye")
    }

    test("the ArgOps parser keeps the correct default values"){
        val argOps1 = parser <<| Array("arg")
        assert(argOps1("someInt").asInt == 4)
        assert(argOps1("someFlag").asBoolean == false)
        assert(argOps1("someWord").asString == "hello")
    }

    test("the ArgOps parser keeps the correct number of arg"){
        val argOps1 = parser <<| Array("-someInt", "3", "-someFlag", "-someWord", "goodbye", "arg0", "arg1", "arg2")
        assert(argOps1.args(0) == "arg0")
        assert(argOps1.args(1) == "arg1")
        assert(argOps1.args(2) == "arg2")
    }

    test("the ArgOps parser doesn't return nulls"){
        val argOps1 = parser <<| Array("-someInt", "3", "-someFlag", "-someWord", "goodbye", "arg0", "arg1", "arg2")
        assert(argOps1.args(0) == "arg0")
        assert(argOps1.args(1) == "arg1")
        assert(argOps1.args(2) == "arg2")
    }

}<commit_msg>added extra test to the parser<commit_after>package com.lamaVersion.impl

import org.scalatest.FunSuite
import EasyIO._

class EasyIOTest extends FunSuite {

    val parser = ArgOps("someInt" -> 4, "someFlag", "someWord" -> "hello")

    test("the ArgOps parser rejects unknow options") {
        intercept[UnknownOption](parser <<| Array("-nothing"))
    }

    test("the ArgOps parser rejects options without args"){
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someInt","-someFlag"))
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someWord", "-someFlag"))
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someInt"))
        intercept[OptionWithoutExpectedParam](parser <<| Array("-someWord"))
    }
    
    test("the ArgOps parser reads the correct values"){
        val argOps1 = parser <<| Array("-someInt", "3", "-someFlag", "-someWord", "goodbye")
        assert(argOps1("someInt").asInt == 3)
        assert(argOps1("someFlag").asBoolean == true)
        assert(argOps1("someWord").asString == "goodbye")
    }

    test("the ArgOps parser keeps the correct default values"){
        val argOps1 = parser <<| Array("arg")
        assert(argOps1("someInt").asInt == 4)
        assert(argOps1("someFlag").asBoolean == false)
        assert(argOps1("someWord").asString == "hello")
    }

    test("the ArgOps parser keeps the correct number of arg"){
        val argOps1 = parser <<| Array("-someInt", "3", "-someFlag", "-someWord", "goodbye", "arg0", "arg1", "arg2")
        assert(argOps1.args(0) == "arg0")
        assert(argOps1.args(1) == "arg1")
        assert(argOps1.args(2) == "arg2")
    }

    test("the ArgOps parser doesn't return nulls"){
        val argOps1 = parser <<| Array("-someInt", "3", "-someFlag", "-someWord", "goodbye")
        assert(argOps1.args.length == 0)
    }

}
{'fraction_non_alphanumeric': 0.17034700315457413, 'fraction_numerical': 0.01840168243953733, 'mean_word_length': 3.4870283018867925, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 7, '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': '4905341', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1169, 'n_words': 256}