<commit_before>local luagi = require( "luagi" )
describe("version", function()
   describe( "current", function()
      mayor, minor, patch = luagi.version()

      it( "mayor", function()
         assert.are.equal( 0, mayor )
      end)
      it("minor", function()
         assert.are.equal( 21, minor )
      end)
      it("patch", function()
         assert.are.equal( 0, patch )
      end)
   end)
end)

describe("init", function()
   describe("positive", function()
      local repopath = "data/testrepo.git"
      local repo, err = luagi.init( repopath, true )
      it( "should be a repo", function()
         assert.is.not_nil( repo )
         assert.are.equal( "userdata", type( repo ) )
      end)
      it( "should be null", function()
         assert.is.falsy( err )
      end)
      
      it( "should be bare", function()
         assert.is_true( repo:is_bare() )
      end)
      it( "should be empty", function()
         assert.is_true( repo:is_empty() )
      end)
   end)

   describe("invalid path", function()
      local repopath = "data/path/that/does/not/exist"
      local opts = {}
      local repo, err = luagi.init_ext( repopath, opts )
      it( "should be nil", function()
         assert.is.falsy( repo )
      end)
      it( "err is filled", function()
         assert.is.not_nil( err )
         assert.are.equal( "string", type( err ) )
      end)
   end)
end)

describe("global config", function()

   it( "should not be nil", function()
      local path = luagi:find_global_config()
      assert.is.not_nil( path )
   end)
end)

<commit_msg>Added config parse test cases<commit_after>local luagi = require( "luagi" )
describe("version", function()
   describe( "current", function()
      mayor, minor, patch = luagi.version()

      it( "mayor", function()
         assert.are.equal( 0, mayor )
      end)
      it("minor", function()
         assert.are.equal( 21, minor )
      end)
      it("patch", function()
         assert.are.equal( 0, patch )
      end)
   end)
end)

describe("init", function()
   describe("positive", function()
      local repopath = "data/testrepo.git"
      local repo, err = luagi.init( repopath, true )
      it( "should be a repo", function()
         assert.is.not_nil( repo )
         assert.are.equal( "userdata", type( repo ) )
      end)
      it( "should be null", function()
         assert.is.falsy( err )
      end)
      
      it( "should be bare", function()
         assert.is_true( repo:is_bare() )
      end)
      it( "should be empty", function()
         assert.is_true( repo:is_empty() )
      end)
   end)

   describe("invalid path", function()
      local repopath = "data/path/that/does/not/exist"
      local opts = {}
      local repo, err = luagi.init_ext( repopath, opts )
      it( "should be nil", function()
         assert.is.falsy( repo )
      end)
      it( "err is filled", function()
         assert.is.not_nil( err )
         assert.are.equal( "string", type( err ) )
      end)
   end)
end)

describe("global config", function()

   it( "should not be nil", function()
      local path = luagi:find_global_config()
      assert.is.not_nil( path )
   end)
end)

describe("config parse bool", function()

   it( "should be true", function()
      assert.is.True( luagi.parse_bool( "true" ) )
   end)

   it( "should be true", function()
      assert.is_true( luagi.parse_bool( "True" ) )
   end)

   it( "should be true", function()
      assert.is_true( luagi.parse_bool( "trUE" ) )
   end)

   it( "should be true", function()
      assert.is_true( luagi.parse_bool( "TRUE" ) )
   end)

   it( "should be false", function()
      assert.is_false( luagi.parse_bool( "False" ) )
   end)

   it( "should be false", function()
      assert.is_false( luagi.parse_bool( "false" ) )
   end)
   
   it( "should be false", function()
      assert.is_false( luagi.parse_bool( "FALSE" ) )
   end)

   it( "should be false", function()
      assert.is_false( luagi.parse_bool( "falSE" ) )
   end)
end)

describe( "parse_int32", function()
   it( "should be 1", function()
      assert.is_equal( 1, luagi.parse_int32( "1" ))
   end)
   it( "should be 1", function()
      assert.is_equal( 1, luagi.parse_int32( "+1" ))
   end)
   it( "should be 0", function()
      assert.is_equal( 0, luagi.parse_int32( "0" ))
   end)
   it( "should be -1", function()
      assert.is_equal( -1, luagi.parse_int32( "-1" ))
   end)
   it( "should be 2147483647", function()
      assert.is_equal( 2147483647, luagi.parse_int32( "2147483647" ))
   end)
   it( "should be 2147483647", function()
      assert.is_equal( 2147483647, luagi.parse_int32( "+2147483647" ))
   end)
   it( "should be -2147483648", function()
      assert.is_equal( -2147483648, luagi.parse_int32( "-2147483648" ))
   end)
   it( "should have error", function()
      assert.has_error( function() luagi.parse_int32( "2147483648" ) end)
   end)
   it( "should have error", function()
      assert.has_error( function() luagi.parse_int32( "-2147483649") end )
   end)
end)

describe("parse_int64", function()
   it("should be 1", function()
      assert.is_equal(1, luagi.parse_int64( "1" ) )
   end)

   it("should be 1", function()
      assert.is_equal(1, luagi.parse_int64( "+1" ) )
   end)

   it("should be 0", function()
      assert.is_equal(0, luagi.parse_int64( "0" ) )
   end)

   it("should be -1", function()
      assert.is_equal(-1, luagi.parse_int64( "-1" ) )
   end)

   it("should be 9223372036854775807", function()
      assert.is_equal( 9223372036854775807, luagi.parse_int64( "9223372036854775807" ) )
   end)

   it( "should have error", function()
      assert.has_error( function() luagi.parse_int64( "9223372036854775808" ) end )
   end)

   it("should be -9223372036854775807", function()
      assert.is_equal( -9223372036854775807, luagi.parse_int64( "-9223372036854775807" ) )
   end)

   it("should have error", function()
      assert.has_error( function() luagi.parse_int64( "-9223372036854775808" ) end )
   end)
end)

{'fraction_non_alphanumeric': 0.146759953356655, 'fraction_numerical': 0.05530568049308679, 'mean_word_length': 2.6343825665859564, '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': '2039835', 'n_tokens_mistral': 2293, 'n_tokens_neox': 2079, 'n_words': 525}