<commit_before>-module(acceptance).
-export([test/0]).
-compile(export_all).

test() ->
    io:format("### beginning eredis acceptance test~n"),
    eredis:start(),
    ok = eredis:set(foo, bar),
    {ok, bar} = eredis:get(foo),
    ok = eredis:delete(foo),
    undefined = eredis:get(foo),
    ok = eredis:watch(foo),
    ok = eredis:set(foo, baz),
    ok = eredis:multi(),
    stored = eredis:set(foo, baz),
    error = eredis:exec(),
    {ok, baz} = eredis:get(foo),
    io:format("### eredis acceptance test passed~n").
<commit_msg>breaking out acceptance test into individual tests and adding a few more<commit_after>-module(acceptance).
-export([test/0]).
-compile(export_all).

test() ->
    io:format("Starting eredis acceptance tests~n"),
    eredis:start(),
    test_get_set(),
    test_delete(),
    test_transaction(),
    test_watch(),
    test_unwatch(),
    io:format("All tests passed~n").

test_get_set() ->
    io:format("### beginning test_get_set~n"),
    ok = eredis:set(foo, bar),
    {ok, bar} = eredis:get(foo),
    io:format("test_get_set passed ###~n").

test_delete() ->
    io:format("### beginning test_delete~n"),
    ok = eredis:set(foo, bar),
    ok = eredis:delete(foo),
    undefined = eredis:get(foo),
    io:format("test_delete passed ###~n").

test_transaction() ->
    io:format("### beginning test_transaction~n"),
    ok = eredis:set(foo, baz),
    ok = eredis:multi(),
    stored = eredis:get(foo),
    stored = eredis:set(foo, bar),
    {ok, [{ok, baz}, ok]} = eredis:exec(),
    {ok, bar} = eredis:get(foo),
    io:format("test_transaction passed ###~n").

test_watch() ->
    io:format("### beginning test_watch~n"),
    ok = eredis:watch(foo),
    ok = eredis:set(foo, baz),
    ok = eredis:multi(),
    stored = eredis:set(foo, bar),
    error = eredis:exec(),
    {ok, baz} = eredis:get(foo),
    io:format("test_watch passed ###~n").

test_unwatch() ->
    io:format("### beginning test_unwatch~n"),
    ok = eredis:watch(foo),
    ok = eredis:set(foo, baz),
    ok = eredis:unwatch(),
    ok = eredis:multi(),
    stored = eredis:set(foo, bar),
    {ok, [ok]} = eredis:exec(),
    {ok, bar} = eredis:get(foo),
    io:format("test_unwatch passed ###~n").

{'fraction_non_alphanumeric': 0.1970040853381752, 'fraction_numerical': 0.0009078529278256923, 'mean_word_length': 3.75, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '1300549', 'n_tokens_mistral': 836, 'n_tokens_neox': 840, 'n_words': 167}