<commit_before>require "busted.runner" ()

local assert = require "luassert"

describe ("the c3 module", function ()

  it ("can be required", function ()
    assert.has.no.error (function ()
      require "c3"
    end)
  end)

  it ("can be instantiated", function ()
    assert.has.no.error (function ()
      local C3 = require "c3"
      C3.new {
        superclass = function (x) return x end,
      }
    end)
  end)
<commit_msg>Add test for illegal superclass function.<commit_after>require "busted.runner" ()

local assert = require "luassert"

describe ("the c3 module", function ()

  it ("can be required", function ()
    assert.has.no.error (function ()
      require "c3"
    end)
  end)

  it ("can be instantiated", function ()
    assert.has.no.error (function ()
      local C3 = require "c3"
      C3.new {
        superclass = function (x) return x end,
      }
    end)
  end)

  it ("detects non-callable superclass", function ()
    assert.has.error (function ()
      local C3 = require "c3"
      C3.new {
        superclass = true,
      }
    end)
  end)

{'fraction_non_alphanumeric': 0.1266173752310536, 'fraction_numerical': 0.012014787430683918, 'mean_word_length': 2.449044585987261, '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': '3465239', 'n_tokens_mistral': 357, 'n_tokens_neox': 347, 'n_words': 105}