From e62ec5ac36188cb12411a8c720daebce77ecf645 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Mon, 27 May 2024 00:11:26 -0300 Subject: Set up a "build system" --- testc.lua | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 testc.lua (limited to 'testc.lua') diff --git a/testc.lua b/testc.lua deleted file mode 100644 index e9a793c..0000000 --- a/testc.lua +++ /dev/null @@ -1,41 +0,0 @@ - -local function printr(...) - print(...) - return ... -end - -local collect = {} -local function printr_collect(...) - table.insert(collect, (...)) - return printr(...) -end - --- used to print what the lua parser (load) is seeing, after cratera has done its thing -loadstring = nil -local realload = load -load = function(target, ...) - if type(target) == "function" then - return realload(function() return printr_collect(target()) end, ...) - else - return realload(printr_collect(target), ...) - end -end - -local cratera = require "cratera" - --- first test: does it handle empty files properly? -assert(printr(cratera.load("")))() - --- second test: does it handle lua code properly? -assert(printr(cratera.load(io.open("cratera/compiler.lua"):read("*a"))))() - -print("-----------------------------------------------------------------------------------------------------------------------") -print(table.concat(collect)) - -collect = {} - --- third test: does it handle cratera tests properly? -assert(printr(cratera.load(io.open("tests.cratera"):read("*a"))))() - -print("-----------------------------------------------------------------------------------------------------------------------") -print(table.concat(collect)) -- cgit 1.4.1