<commit_before>local tableShape = require('src.propTypeValidators.tableShape')

local function trueValidator()
  return true 
end

local function falseValidator()
  return false 
end

describe('tableShape', function()
  describe('error states', function()
    it('causes an error is the table shape description is not expressed as a table', function()
      expect(function()
        tableShape('hi')
      end).to.fail()
    end)
  end)

  describe('behaviour', function()
    it('returns false if a table is not specified to the validator', function()
      local validateEmptyTable = tableShape({})

      expect(validateEmptyTable('test'))<commit_msg>make tableShape test consistent<commit_after>local tableShape = require('src.propTypeValidators.tableShape')

local function trueValidator()
  return true 
end

local function falseValidator()
  return false 
end

describe('tableShape', function()
  describe('error states', function()
    it('causes an error is the table shape description is not expressed as a table', function()
      expect(function()
        tableShape()
      end).to.fail()

      expect(function()
        tableShape('test')
      end).to.fail()

      expect(function()
        tableShape(12)
      end).to.fail()

      expect(function()
        tableShape(true)
      end).to.fail()

      expect(function()
        tableShape(function() end)
      end).to.fail()
    end)
  end)

  describe('behaviour', function()
    it('returns false if a table is not specified to the validator', function()
      local validateEmptyTable = tableShape({})

      expect(validateEmptyTable())
        .to.be(false)

      expect(validateEmptyTable('test'))
{'fraction_non_alphanumeric': 0.11217183770883055, 'fraction_numerical': 0.0011933174224343676, 'mean_word_length': 3.4601063829787235, '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': '4323890', 'n_tokens_mistral': 460, 'n_tokens_neox': 445, 'n_words': 133}