<commit_before># coding: utf-8
require 'gir_ffi_test_helper'

require 'gir_ffi'

GirFFI.setup :Pango

# Tests generated methods and functions in the Pango namespace.
describe Pango do
  describe Pango::Language do
    it "has a working method get_scripts" do
      lang = Pango::Language.from_string 'ja'
      scripts = lang.get_scripts
      scripts.to_a.must_equal [:han, :katakana, :hiragana]
    end
  end
end
<commit_msg>Make Pango integration test work with older introspection data<commit_after># coding: utf-8
require 'gir_ffi_test_helper'

require 'gir_ffi'

GirFFI.setup :Pango

# Tests generated methods and functions in the Pango namespace.
describe Pango do
  describe Pango::Language do
    it "has a working method get_scripts" do
      lang = Pango::Language.from_string 'ja'
      result = lang.get_scripts

      if GLib::SizedArray === result
        scripts = result
      else
        ptr, size = *result
        scripts = GLib::SizedArray.new Pango::Script, size, ptr
      end

      scripts.to_a.must_equal [:han, :katakana, :hiragana]
    end
  end
end

{'fraction_non_alphanumeric': 0.08063021316033364, 'fraction_numerical': 0.0018535681186283596, 'mean_word_length': 3.4081632653061225, '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': '4541950', 'n_tokens_mistral': 358, 'n_tokens_neox': 353, 'n_words': 109}