<commit_before>load "../common/common"

declare -gra OPTIONS=("--stdin" "--tokens")

@test "lexer: equal" {
	declare -r INPUT="=="
	declare -r OUTPUT='[{"offset":0,"type":"equal","value":"=="}]'
	test_json_output
}

@test "lexer: not_equal" {
	declare -r INPUT="/="
	declare -r OUTPUT='[{"offset":0,"type":"not_equal","value":"/="}]'
	test_json_output
}

@test "lexer: less" {
	declare -r INPUT="<"
	declare -r OUTPUT='[{"offset":0,"type":"less","value":"<"}]'
	test_json_output
}

@test "lexer: less_or_equal" {
	declare -r INPUT="<="
	declare -r OUTPUT='[{"offset":0,"type":"less_or_equal","value":"<="}]'
	test_json_output
}

@test "lexer: great" {
	declare -r INPUT=">"
	declare -r OUTPUT='[{"offset":0,"type":"great","value":">"}]'
	test_json_output
}

@test "lexer: great_or_equal" {
	declare -r INPUT=">="
	declare -r OUTPUT='[{"offset":0,"type":"great_or_equal","value":">="}]'
	test_json_output
}

@test "lexer: plus" {
	declare -r INPUT="+"
	declare -r OUTPUT='[{"offset":0,"type":"plus","value":"+"}]'
	test_json_output
}

@test "lexer: minus" {
	declare -r INPUT="-"
	declare -r OUTPUT='[{"offset":0,"type":"minus","value":"-"}]'
	test_json_output
}

@test "lexer: star" {
	declare -r INPUT="*"<commit_msg>Simplify a grammar in the example: remove useless tests of the `lexer` module<commit_after>load "../common/common"

declare -gra OPTIONS=("--stdin" "--tokens")

@test "lexer: plus" {
	declare -r INPUT="+"
	declare -r OUTPUT='[{"offset":0,"type":"plus","value":"+"}]'
	test_json_output
}

@test "lexer: minus" {
	declare -r INPUT="-"
	declare -r OUTPUT='[{"offset":0,"type":"minus","value":"-"}]'
	test_json_output
}

@test "lexer: star" {
	declare -r INPUT="*"
{'fraction_non_alphanumeric': 0.2520858164481526, 'fraction_numerical': 0.0059594755661501785, 'mean_word_length': 5.742971887550201, 'pattern_counts': {'":': 30, '<': 7, '<?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': '1071300', 'n_tokens_mistral': 702, 'n_tokens_neox': 663, 'n_words': 135}