<commit_before># -*- coding: utf-8 -*-

require "testutils"

module Lazy::PP
  class JSON::ArrayTest < Test::Unit::TestCase
    include Lazy::PP::JSON::TestUtils

    def test_empty
      assert_lazy_json("[]\n", '[]')
    end

    def test_single
      assert_lazy_json('["1"]' + "\n", '["1"]')
    end

    def test_short_double
      assert_lazy_json('["1", "2"]' + "\n", '["1", "2"]')
    end

    def test_double
      assert_lazy_json(<<EXPECTED, '["first", "last"]')
[
  "first",
  "last"
]
EXPECTED
    end

    def test_including_array
      actual_string = '["first", ["first-first", "first-last"], "last"]'
      assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  [
    "first-first",
    "first-last"
  ],
  "last"
]
EXPECTED
    end

    def test_including_short_array
      actual_string = '["first", ["1","2"], "last"]'
      assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  ["1", "2"],
  "last"
]
EXPECTED
    end

    def test_including_array_including_array
      actual_string = <<ACTUAL
["first", ["first-first", ["first-first-first", "first-first-last"]], "last"]
ACTUAL
      assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  [
    "first-first",
    [
      "first-first-first",
      "first-first-last"
    ]
  ],
  "last"
]
EXPECTED
    end

    def test_including_hash
      actual_string = <<ACTUAL
["first", {"key":"value"}, "last"]
ACTUAL
      assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  {
    "key":"value"
  },
  "last"
]
EXPECTED
    end

    def test_short_including_hash
      actual_string = <<ACTUAL
["a", {"key":"value"}, "b"]
ACTUAL
      assert_lazy_json(<<EXPECTED, actual_string)
[
  "a",
  {
    "key":"value"
  },
  "b"
]
EXPECTED
    end
  end
end<commit_msg>test: split module or class name in Lazy::PP::JSON::ArrayTest<commit_after># -*- coding: utf-8 -*-

require "testutils"

module Lazy
  module PP
    class JSON
      class ArrayTest < Test::Unit::TestCase
        include Lazy::PP::JSON::TestUtils

        def test_empty
          assert_lazy_json("[]\n", '[]')
        end

        def test_single
          assert_lazy_json('["1"]' + "\n", '["1"]')
        end

        def test_short_double
          assert_lazy_json('["1", "2"]' + "\n", '["1", "2"]')
        end

        def test_double
          assert_lazy_json(<<EXPECTED, '["first", "last"]')
[
  "first",
  "last"
]
EXPECTED
        end

        def test_including_array
          actual_string = '["first", ["first-first", "first-last"], "last"]'
          assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  [
    "first-first",
    "first-last"
  ],
  "last"
]
EXPECTED
        end

        def test_including_short_array
          actual_string = '["first", ["1","2"], "last"]'
          assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  ["1", "2"],
  "last"
]
EXPECTED
        end

        def test_including_array_including_array
          actual_string = <<ACTUAL
["first", ["first-first", ["first-first-first", "first-first-last"]], "last"]
ACTUAL
          assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  [
    "first-first",
    [
      "first-first-first",
      "first-first-last"
    ]
  ],
  "last"
]
EXPECTED
        end

        def test_including_hash
          actual_string = <<ACTUAL
["first", {"key":"value"}, "last"]
ACTUAL
          assert_lazy_json(<<EXPECTED, actual_string)
[
  "first",
  {
    "key":"value"
  },
  "last"
]
EXPECTED
        end

        def test_short_including_hash
          actual_string = <<ACTUAL
["a", {"key":"value"}, "b"]
ACTUAL
          assert_lazy_json(<<EXPECTED, actual_string)
[
  "a",
  {
    "key":"value"
  },
  "b"
]
EXPECTED
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.17326866073834546, 'fraction_numerical': 0.005928321207221773, 'mean_word_length': 2.617933723196881, 'pattern_counts': {'":': 8, '<': 41, '<?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': '4780115', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1362, 'n_words': 250}