<commit_before># coding: utf-8
require "minitest/autorun"
require "zig"

describe ZIG do

  describe "empty" do
    it "should reject an empty document" do
      assert_raises(RuntimeError) { ZIG.parse("") }
    end
  end

  describe "literals" do
    it "should parse nil" do
      assert_equal nil, ZIG.parse("nil")
    end

    it "should parse true" do
      assert_equal true, ZIG.parse("true")
    end

    it "should parse false" do
      assert_equal false, ZIG.parse("false")
    end

    it "should reject other literals" do
      assert_raises(RuntimeError) { ZIG.parse("foo") }
    end
  end

  describe "integers" do
    it "should parse zero" do
      assert_equal 0, ZIG.parse("0")
    end

    it "should parse positive integers" do
      assert_equal 7, ZIG.parse("7")
      assert_equal 23, ZIG.parse("23")
    end

    it "should parse negative integers" do
      assert_equal -7, ZIG.parse("-7")
      assert_equal -23, ZIG.parse("-23")
    end
  end

  describe "floats" do
    it "should parse zero" do
      assert_equal 0.0, ZIG.parse("0.0")
    end

    it "should parse positive floats" do
      assert_equal 0.07, ZIG.parse("0.07")
      assert_equal 23.9, ZIG.parse("23.9")
    end

    it "should parse negative floats" do
      assert_equal -0.07, ZIG.parse("-0.07")
      assert_equal -23.9, ZIG.parse("-23.9")
    end

    it "should parse pi" do
      assert_equal 3.14159265359, ZIG.parse("3.14159265359")
    end

    it "should parse exponential notation" do
      assert_equal 2.3e-10, ZIG.parse("2.3e-10")
      assert_equal 2.3e10, ZIG.parse("2.3e+10")
      assert_equal 2.3e10, ZIG.parse("2.3e10")
      assert_equal 2.3e10, ZIG.parse("2.3E10")
    end
  end

  describe "strings" do
    it "should parse simple strings" do
      assert_equal "foo bar", ZIG.parse("'foo bar'")
    end

    it "should parse unicode strings" do
      assert_equal "Übung macht den Meister", ZIG.parse("'Übung macht den Meister'")
    end
  end

  describe "multiline strings" do
    it "should parse multiline strings" do
      doc =
%{"
   one house
   two houses
   three houses}
      assert_equal "one house\ntwo houses\nthree houses", ZIG.parse(doc)
    end
  end


  describe "lists" do
    it "should parse an empty list" do
      assert_equal [], ZIG.parse("[")
    end

    it "should parse a list of simple values" do
      doc =
"[
   1
   2
   3"
      assert_equal [1, 2, 3], ZIG.parse(doc)
    end

    it "should parse a list of complex values" do
      doc =
"[
   [
      23
      42
   [
   {
      a: 1
      b: 2"
      assert_equal [[23, 42], [], {a: 1, b: 2}], ZIG.parse(doc)
    end
  end

  describe "hashes" do
    it "should parse an empty hash" do
      assert_equal Hash.new, ZIG.parse("{")
    end

    it "should parse a hash with simple values" do
      doc =
"{
   a: 1
   b: 2
   c: 3"
      assert_equal Hash[a: 1, b: 2, c: 3], ZIG.parse(doc)
    end

    it "should parse a hash with complex values" do
      doc =
"{
   x: {
      a: 1
      b: 2
   y: {
   z: [
      true
      false"
      assert_equal Hash[x: {a: 1, b: 2}, y: {}, z: [true, false]], ZIG.parse(doc)
    end

    it "should reject empty keys" do
      doc =
"{
   a: 1
   : 2
   c: 3"
      assert_raises(RuntimeError) { ZIG.parse(doc) }
    end
  end

  describe "comments" do
  end

end<commit_msg>fixed tests (changed indent to 2)<commit_after># coding: utf-8
require "minitest/autorun"
require "zig"

describe ZIG do

  describe "empty" do
    it "should reject an empty document" do
      assert_raises(RuntimeError) { ZIG.parse("") }
    end
  end

  describe "literals" do
    it "should parse nil" do
      assert_equal nil, ZIG.parse("nil")
    end

    it "should parse true" do
      assert_equal true, ZIG.parse("true")
    end

    it "should parse false" do
      assert_equal false, ZIG.parse("false")
    end

    it "should reject other literals" do
      assert_raises(RuntimeError) { ZIG.parse("foo") }
    end
  end

  describe "integers" do
    it "should parse zero" do
      assert_equal 0, ZIG.parse("0")
    end

    it "should parse positive integers" do
      assert_equal 7, ZIG.parse("7")
      assert_equal 23, ZIG.parse("23")
    end

    it "should parse negative integers" do
      assert_equal -7, ZIG.parse("-7")
      assert_equal -23, ZIG.parse("-23")
    end
  end

  describe "floats" do
    it "should parse zero" do
      assert_equal 0.0, ZIG.parse("0.0")
    end

    it "should parse positive floats" do
      assert_equal 0.07, ZIG.parse("0.07")
      assert_equal 23.9, ZIG.parse("23.9")
    end

    it "should parse negative floats" do
      assert_equal -0.07, ZIG.parse("-0.07")
      assert_equal -23.9, ZIG.parse("-23.9")
    end

    it "should parse pi" do
      assert_equal 3.14159265359, ZIG.parse("3.14159265359")
    end

    it "should parse exponential notation" do
      assert_equal 2.3e-10, ZIG.parse("2.3e-10")
      assert_equal 2.3e10, ZIG.parse("2.3e+10")
      assert_equal 2.3e10, ZIG.parse("2.3e10")
      assert_equal 2.3e10, ZIG.parse("2.3E10")
    end
  end

  describe "strings" do
    it "should parse simple strings" do
      assert_equal "foo bar", ZIG.parse("'foo bar'")
    end

    it "should parse unicode strings" do
      assert_equal "Übung macht den Meister", ZIG.parse("'Übung macht den Meister'")
    end
  end

  describe "multiline strings" do
    it "should parse multiline strings" do
      doc =
%{"
  one house
  two houses
  three houses}
      assert_equal "one house\ntwo houses\nthree houses", ZIG.parse(doc)
    end
  end


  describe "lists" do
    it "should parse an empty list" do
      assert_equal [], ZIG.parse("[")
    end

    it "should parse a list of simple values" do
      doc =
"[
  1
  2
  3"
      assert_equal [1, 2, 3], ZIG.parse(doc)
    end

    it "should parse a list of complex values" do
      doc =
"[
  [
    23
    42
  [
  {
    a: 1
    b: 2"
      assert_equal [[23, 42], [], {a: 1, b: 2}], ZIG.parse(doc)
    end
  end

  describe "hashes" do
    it "should parse an empty hash" do
      assert_equal Hash.new, ZIG.parse("{")
    end

    it "should parse a hash with simple values" do
      doc =
"{
  a: 1
  b: 2
  c: 3"
      assert_equal Hash[a: 1, b: 2, c: 3], ZIG.parse(doc)
    end

    it "should parse a hash with complex values" do
      doc =
"{
  x: {
    a: 1
    b: 2
  y: {
  z: [
    true
    false"
      assert_equal Hash[x: {a: 1, b: 2}, y: {}, z: [true, false]], ZIG.parse(doc)
    end

    it "should reject empty keys" do
      doc =
"{
  a: 1
  : 2
  c: 3"
      assert_raises(RuntimeError) { ZIG.parse(doc) }
    end
  end

  describe "comments" do
  end

end
{'fraction_non_alphanumeric': 0.11653116531165311, 'fraction_numerical': 0.03929539295392954, 'mean_word_length': 2.259568204121688, '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': '6390203', 'n_tokens_mistral': 2587, 'n_tokens_neox': 2388, 'n_words': 756}