Improved loading of pretty.
This commit is contained in:
parent
6a677a65b2
commit
00d3f653a8
5
init.lua
5
init.lua
|
@ -1 +1,4 @@
|
|||
return require 'pretty.pretty'
|
||||
|
||||
local premodule = (...)
|
||||
if premodule == 'init' then premodule = '' end
|
||||
return require (premodule .. (premodule ~= '' and '.' or '') .. 'pretty')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local SUITE = require('TestSuite').new('analyze_structure')
|
||||
local SUITE = require 'TestSuite' 'analyze_structure'
|
||||
SUITE:setEnviroment {
|
||||
analyze_structure = require('analyze_structure'),
|
||||
TABLE_TYPE = require('table_type')
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local SUITE = require('TestSuite').new('function')
|
||||
local SUITE = require 'TestSuite' 'function'
|
||||
SUITE:setEnviroment{
|
||||
format = require('pretty')
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local SUITE = require('TestSuite').new('number')
|
||||
local SUITE = require 'TestSuite' 'number'
|
||||
SUITE:setEnviroment{
|
||||
format = require('pretty')
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local SUITE = require('TestSuite').new('pretty')
|
||||
local SUITE = require 'TestSuite' 'pretty'
|
||||
SUITE:setEnviroment{
|
||||
format = require('pretty')
|
||||
}
|
||||
|
@ -395,6 +395,8 @@ SUITE:addTest('UseCase: Can load function from file that is shortly deleted', fu
|
|||
local yo = require(module_name)
|
||||
-- Remove module
|
||||
os.remove('./'..module_name..'.lua')
|
||||
package.loaded[module_name] = nil
|
||||
|
||||
-- Format the function, even though the module it came from is gone.
|
||||
format(yo)
|
||||
assert(true)
|
||||
|
|
|
@ -22,7 +22,7 @@ end
|
|||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
local SUITE = require('TestSuite').new('resilience')
|
||||
local SUITE = require 'TestSuite' 'resilience'
|
||||
SUITE:setEnviroment{
|
||||
pretty = require('pretty'),
|
||||
setfenv = setfenv,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
local SUITE = require('TestSuite').new('sorting')
|
||||
local SUITE = require 'TestSuite' 'sorting'
|
||||
SUITE:setEnviroment{
|
||||
pretty = require('pretty')
|
||||
}
|
||||
|
|
|
@ -4,6 +4,6 @@ package.path = package.path .. ';./test/?.lua;./src/?.lua'
|
|||
local TEST_SUITE = require("TestSuite").new('pretty')
|
||||
TEST_SUITE:enableStrictGlobal()
|
||||
TEST_SUITE:addModules('test/test_*')
|
||||
-- TEST_SUITE:generateRequireSubmodule 'require'
|
||||
TEST_SUITE:addModuleTests 'pretty'
|
||||
TEST_SUITE:setOptions(...)
|
||||
TEST_SUITE:runTests()
|
||||
|
|
Loading…
Reference in New Issue
Block a user