<commit_before># frozen_string_literal: true

require "introspection_test_helper"

describe GObjectIntrospection::IBaseInfo do
  let(:described_class) { GObjectIntrospection::IBaseInfo }
  describe "#initialize" do
    it "raises an error if a null pointer is passed" do
      expect(ptr = Object.new).to receive(:null?).and_return true
      _(proc { described_class.new ptr }).must_raise ArgumentError
    end

    it "raises no error if a non-null pointer is passed" do
      expect(ptr = Object.new).to receive(:null?).and_return false
      described_class.new ptr
      pass
    end
  end

  describe "#deprecated?" do
    let(:deprecated_info) { get_introspection_data "Regress", "test_versioning" }
    let(:other_info) { get_introspection_data "Regress", "test_value_return" }

    it "returns true for a deprecated item" do
      _(deprecated_info).must_be :deprecated?
    end<commit_msg>Don't test IBaseInfo with mock pointers<commit_after># frozen_string_literal: true

require "introspection_test_helper"

describe GObjectIntrospection::IBaseInfo do
  let(:described_class) { GObjectIntrospection::IBaseInfo }
  describe "#initialize" do
    it "raises an error if a null pointer is passed" do
      _(proc { described_class.new FFI::Pointer::NULL }).must_raise ArgumentError
    end
  end

  describe "#deprecated?" do
    let(:deprecated_info) { get_introspection_data "Regress", "test_versioning" }
    let(:other_info) { get_introspection_data "Regress", "test_value_return" }

    it "returns true for a deprecated item" do
      _(deprecated_info).must_be :deprecated?
    end
{'fraction_non_alphanumeric': 0.09085213032581453, 'fraction_numerical': 0.0, 'mean_word_length': 4.469178082191781, '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': '5038582', 'n_tokens_mistral': 491, 'n_tokens_neox': 483, 'n_words': 133}