<commit_before># frozen_string_literal: true

require "test_helper"

describe "wa_exists" do
  let(:s0) { S0.create_default! }

  it "has_many with #limit(0) never matches" do
    s0.create_assoc!(:m1, :S0_m1)

    assert_exists_without_matching(:m1) { |s| s.limit(0) }
  end

  it "has_one with #limit(0) never matches" do
    skip if Test::SelectedDBHelper == Test::MySQL
    s0.create_assoc!(:o1, :S0_o1)

    assert_exists_without_matching(:o1) { |s| s.limit(0) }
  end

  it "belongs_to with #limit(0) never matches" do
    s0.create_assoc!(:b1, :S0_b1)

    assert_exists_without_matching(:b1) { |s| s.limit(0) }
  end

  it "has_and_belongs_to_many with #limit(0) never matches" do
    s0.create_assoc!(:z1, :S0_z1)

    assert_exists_without_matching(:z1) { |s| s.limit(0) }
  end
end
<commit_msg>Add double-check to the limit(0) tests<commit_after># frozen_string_literal: true

require "test_helper"

describe "wa_exists" do
  let(:s0) { S0.create_default! }

  it "has_many with #limit(0) never matches" do
    s0.create_assoc!(:m1, :S0_m1)
    assert_exists_with_matching(:m1)
    assert_exists_without_matching(:m1) { |s| s.limit(0) }
  end

  it "has_one with #limit(0) never matches" do
    skip if Test::SelectedDBHelper == Test::MySQL
    s0.create_assoc!(:o1, :S0_o1)
    assert_exists_with_matching(:o1)
    assert_exists_without_matching(:o1) { |s| s.limit(0) }
  end

  it "belongs_to with #limit(0) never matches" do
    s0.create_assoc!(:b1, :S0_b1)

    assert_exists_with_matching(:b1)
    assert_exists_without_matching(:b1) { |s| s.limit(0) }
  end

  it "has_and_belongs_to_many with #limit(0) never matches" do
    s0.create_assoc!(:z1, :S0_z1)

    assert_exists_with_matching(:z1)
    assert_exists_without_matching(:z1) { |s| s.limit(0) }
  end
end

{'fraction_non_alphanumeric': 0.13194834362717575, 'fraction_numerical': 0.0364963503649635, 'mean_word_length': 4.4495412844036695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6594279', 'n_tokens_mistral': 759, 'n_tokens_neox': 730, 'n_words': 143}