<commit_before>local allTestsOk = true

local function test(s, f)
	print("test " .. s .. " ...")
	local t, ok, msg = measure_time(function() return pcall(f) end)
	print(t .. "s")
	if ok then
		print("OK")
	else
		allTestsOk = false
		if msg then
			print("FAILED " .. msg)
		else
			print("FAILED")
		end
	end
end

local chunkArg1, chunkArg2 = ...
test("chunk_args", function()
	assert(chunkArg1 == 123 and chunkArg2 == "hello")
end)

test("random", function()
	local a = 1
	for i = 1, 100000000 do
		a = (a * 1103515245 + 12345) & 0x7fffffff
	end
	assert(a == 660469505)
end)
<commit_msg>make lua random test smaller<commit_after>local allTestsOk = true

local function test(s, f)
	print("test " .. s .. " ...")
	local t, ok, msg = measure_time(function() return pcall(f) end)
	print(t .. "s")
	if ok then
		print("OK")
	else
		allTestsOk = false
		if msg then
			print("FAILED " .. msg)
		else
			print("FAILED")
		end
	end
end

local chunkArg1, chunkArg2 = ...
test("chunk_args", function()
	assert(chunkArg1 == 123 and chunkArg2 == "hello")
end)

test("random", function()
	local a = 1
	for i = 1, 1000000 do
		a = (a * 1103515245 + 12345) & 0x7fffffff
	end
	assert(a == 345801665)
end)

{'fraction_non_alphanumeric': 0.15113350125944586, 'fraction_numerical': 0.07220822837951302, 'mean_word_length': 3.3663003663003663, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 3, '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': '5861539', 'n_tokens_mistral': 536, 'n_tokens_neox': 455, 'n_words': 136}