<commit_before>--------------------------------------------------------------------------------
--- Tests for ffi-hiredis
-- This file is a part of ffi-hiredis library
-- @copyright ffi-hiredis authors (see file `COPYRIGHT` for the license)
--------------------------------------------------------------------------------
-- TODO: Write proper tests, this is more like an usage example
--------------------------------------------------------------------------------

assert(jit, "LuaJIT 2.0.0+ only")

--------------------------------------------------------------------------------

-- TODO: HACK!
package.path = "src/lua/?.lua;" .. package.path

--------------------------------------------------------------------------------

pcall(require, 'luarocks.require') -- Ignoring errors

--------------------------------------------------------------------------------

require 'lua-nucleo.module'
require 'lua-nucleo.strict'<commit_msg>test: now it is possible to run tests against installed rock<commit_after>--------------------------------------------------------------------------------
--- Tests for ffi-hiredis
-- This file is a part of ffi-hiredis library
-- @copyright ffi-hiredis authors (see file `COPYRIGHT` for the license)
--------------------------------------------------------------------------------
-- TODO: Write proper tests, this is more like an usage example
--------------------------------------------------------------------------------

assert(jit, "LuaJIT 2.0.0+ only")

--------------------------------------------------------------------------------

if (...) ~= "--luarocks" then
  -- Preferring working copy to luarocks tree.
  package.path = "src/lua/?.lua;" .. package.path
end

--------------------------------------------------------------------------------

pcall(require, 'luarocks.require') -- Ignoring errors

--------------------------------------------------------------------------------

require 'lua-nucleo.module'
require 'lua-nucleo.strict'
{'fraction_non_alphanumeric': 0.5516372795969773, 'fraction_numerical': 0.003022670025188917, 'mean_word_length': 0.6731255265374895, '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': '6835299', 'n_tokens_mistral': 381, 'n_tokens_neox': 366, 'n_words': 115}