<commit_before>require 'minitest_helper'

describe "assert_equal_contents" do
  it "passes for same order" do
    a = [1, 2, 3]
    b = a.dup
    assert_equal_contents(a, b)
  end
  it "passes for different order" do
    a = [1, 2, 3]
    b = a.shuffle
    assert_equal_contents(a, b)
  end
  it "complains about missing actual" do
    l = lambda { assert_equal_contents([1, 2, 3], [1, 2]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*\[3\]/im
  end
  it "complains about extra actual" do
    l = lambda { assert_equal_contents([1, 2], [1, 2, 3]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /extraneous actual.*\[3\]/im
  end
end

describe "must_equal_contents" do
  it "passes for same order" do
    a = [1, 2, 3]
    b = a.dup
    a.must_equal_contents b
  end
  it "passes for different order" do
    a = [1, 2, 3]
    b = a.shuffle
    a.must_equal_contents b
  end
  it "complains about missing actual" do
    l = lambda { assert_equal_contents([1, 2, 3], [1, 2]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*\[3\]/im
  end
  it "complains about extra actual" do
    l = lambda { assert_equal_contents([1, 2], [1, 2, 3]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /extraneous actual.*\[3\]/im
  end
end

describe "assert_includes_all" do
  it "passes on empty expected" do
    assert_includes_all([], [])
    assert_includes_all([], [1, 2, 3])
  end
  it "passes on non-empty exptected" do
    assert_includes_all([1, 2], [1, 2, 3])
  end
  it "fails with missing expected" do
    l = lambda { assert_includes_all([1, 2, 3], [1, 2]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*\[3\]/im
  end
end

describe "must_include_all" do
  it "passes on empty expected" do
    [].must_include_all []
    [1, 2, 3].must_include_all []
  end
  it "passes on non-empty exptected" do
    [1, 2, 3].must_include_all [1, 2]
  end
  it "fails with missing expected" do
    l = lambda { [1, 2].must_include_all [1, 2, 3] }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*\[3\]/im
  end
end

describe "assert_true" do
  #it "passes for true" do
  #  assert_true(true)
  #end
  #it "fails for truthy" do
  #  l = lambda { assert_true(1) }
  #  error = assert_raises(MiniTest::Assertion, &l)
  #  error.message.must_match /<true> expected/im
  #end
end

describe "must_be_true" do
  it "passes for true" do
    true.must_be_true # < certainly my proudest coding moment
  end
  it "fails for truthy" do
    l = lambda { 1.must_be_true }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /<true> expected/im
  end
end<commit_msg>fix regexps to work everywhere<commit_after>require 'minitest_helper'

describe "assert_equal_contents" do
  it "passes for same order" do
    a = [1, 2, 3]
    b = a.dup
    assert_equal_contents(a, b)
  end
  it "passes for different order" do
    a = [1, 2, 3]
    b = a.shuffle
    assert_equal_contents(a, b)
  end
  it "complains about missing actual" do
    l = lambda { assert_equal_contents([1, 2, 3], [1, 2]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*\[3\]/im
  end
  it "complains about extra actual" do
    l = lambda { assert_equal_contents([1, 2], [1, 2, 3]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /extraneous actual.*3/im
  end
end

describe "must_equal_contents" do
  it "passes for same order" do
    a = [1, 2, 3]
    b = a.dup
    a.must_equal_contents b
  end
  it "passes for different order" do
    a = [1, 2, 3]
    b = a.shuffle
    a.must_equal_contents b
  end
  it "complains about missing actual" do
    l = lambda { assert_equal_contents([1, 2, 3], [1, 2]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*3/im
  end
  it "complains about extra actual" do
    l = lambda { assert_equal_contents([1, 2], [1, 2, 3]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /extraneous actual.*3/im
  end
end

describe "assert_includes_all" do
  it "passes on empty expected" do
    assert_includes_all([], [])
    assert_includes_all([], [1, 2, 3])
  end
  it "passes on non-empty exptected" do
    assert_includes_all([1, 2], [1, 2, 3])
  end
  it "fails with missing expected" do
    l = lambda { assert_includes_all([1, 2, 3], [1, 2]) }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*3/im
  end
end

describe "must_include_all" do
  it "passes on empty expected" do
    [].must_include_all []
    [1, 2, 3].must_include_all []
  end
  it "passes on non-empty exptected" do
    [1, 2, 3].must_include_all [1, 2]
  end
  it "fails with missing expected" do
    l = lambda { [1, 2].must_include_all [1, 2, 3] }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /missing expected.*3/im
  end
end

describe "assert_true" do
  #it "passes for true" do
  #  assert_true(true)
  #end
  #it "fails for truthy" do
  #  l = lambda { assert_true(1) }
  #  error = assert_raises(MiniTest::Assertion, &l)
  #  error.message.must_match /<true> expected/im
  #end
end

describe "must_be_true" do
  it "passes for true" do
    true.must_be_true # < certainly my proudest coding moment
  end
  it "fails for truthy" do
    l = lambda { 1.must_be_true }
    error = assert_raises(MiniTest::Assertion, &l)
    error.message.must_match /<true> expected/im
  end
end
{'fraction_non_alphanumeric': 0.12444914507315354, 'fraction_numerical': 0.023268112109994712, 'mean_word_length': 3.288737717309146, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2113385', 'n_tokens_mistral': 2212, 'n_tokens_neox': 2127, 'n_words': 607}