<commit_before>defmodule SerumTest do
  use ExUnit.Case, async: true
  import Serum

  @tag :skip
  test "start/2" do
  end

  test "init_data/0" do
    init_data()
    assert %{} == build_data()
  end

  test "put_data/2" do
    init_data()
    put_data(:a, 1)
    assert %{a: 1} == build_data()
  end

  test "get_data/1" do
    init_data()
    put_data(:a, 1)
    assert 1 == get_data(:a)
  end

  defp build_data do
    Agent.get Serum.BuildData, & &1
  end
end
<commit_msg>Add more tests for `Serum` module<commit_after>defmodule SerumTest do
  use ExUnit.Case, async: true
  import Serum

  @tag :skip
  test "start/2" do
  end

  test "init_data/0" do
    init_data()
    assert %{} == build_data()
  end

  test "put_data/2" do
    init_data()
    put_data("key", 123)
    assert %{"key" => 123} == build_data()
  end

  test "get_data/1" do
    init_data()
    put_data("a", 1)
    assert 1 == get_data("a")
  end

  test "put_data/3" do
    init_data()
    put_data("x", "y", 123)
    assert %{"x__y" => 123} == build_data()
  end

  test "get_data/2" do
    init_data()
    put_data("x", "y", 123)
    assert 123 == get_data("x", "y")
  end

  test "del_data/1" do
    init_data()
    put_data("x", 123)
    assert %{"x" => 123} == build_data()
    del_data("x")
    assert %{} == build_data()
  end

  test "del_data/2" do
    init_data()
    put_data("x", "y", 123)
    assert %{"x__y" => 123} == build_data()
    del_data("x", "y")
    assert %{} == build_data()
  end

  defp build_data do
    Agent.get Serum.BuildData, & &1
  end
end

{'fraction_non_alphanumeric': 0.15602836879432624, 'fraction_numerical': 0.032237266279819474, 'mean_word_length': 2.6952380952380954, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4969201', 'n_tokens_mistral': 673, 'n_tokens_neox': 615, 'n_words': 161}