<commit_before>-module(test_erlcfg_interp).
-include_lib("eunit/include/eunit.hrl").


new_test() ->
    ?assertEqual([], erlcfg_interp:new()).

eval_val_with_empty_interp_test() ->
    Interp = erlcfg_interp:new(),
    Expected = {Interp, foo},
    ?assertEqual(Expected, erlcfg_interp:eval(Interp, {val, foo, nil})).

eval_val_with_nonempty_interp_test() ->
    Interp = [{foo, bar}, {bar, baz}],
    Expected = {Interp, 5},
    ?assertEqual(Expected, erlcfg_interp:eval(Interp, {val, 5, nil})).

eval_set_test()  ->
    Interp = erlcfg_interp:new(),
    Expected = {[{foo, bar}], bar},
    ?assertEqual(Expected, erlcfg_interp:eval(Interp, {set, foo, bar})).<commit_msg>Update erlcfg_interp unittests, to work properly again<commit_after>-module(test_erlcfg_interp).
-include_lib("eunit/include/eunit.hrl").


new_test() ->
    ?assertEqual({c, '', []}, erlcfg_interp:new()).

eval_val_with_empty_interp_test() ->
    Interp = erlcfg_interp:new(),
    Expected = {Interp, foo},
    ?assertEqual(Expected, erlcfg_interp:eval(Interp, {val, foo, nil})).

eval_val_with_nonempty_interp_test() ->
    Interp = {c, '', [{d, foo, bar}, {d, bar, baz}]},
    Expected = {Interp, 5},
    ?assertEqual(Expected, erlcfg_interp:eval(Interp, {val, 5, nil})).

eval_set_test()  ->
    Interp = erlcfg_interp:new(),
    Expected = {{c, '', [{d, foo, bar}]}, bar},
    ?assertEqual(Expected, erlcfg_interp:eval(Interp, {set, foo, bar})).
{'fraction_non_alphanumeric': 0.18692902319044272, 'fraction_numerical': 0.0028109627547434997, 'mean_word_length': 4.933333333333334, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '2825384', 'n_tokens_mistral': 567, 'n_tokens_neox': 549, 'n_words': 94}