Commit Graph

7 Commits (1f58896054375e39d096c727d779f3365cd63fa5)

Author SHA1 Message Date
myk002 5af1b627cb
add tests, move expect.lua
I moved expect.lua from library/lua/test/ to library/lua/internal since
luacov is configured to ignore any file with /test/ in its path
2021-04-04 17:37:36 -07:00
lethosor 62776f5568
Move `expect` functions to a separate file
This allows tests to test these functions without needing to include the test
wrapper directly (now ci/test.lua, formerly test/main.lua). Hopefully this
location is also more stable, similar to other libraries that are already tested.
2021-03-24 00:48:52 -04:00
myk002 5f00183177
move test harness out of test dir
and install to test.lua in top-level scripts directory instead of test/main.lua
2021-03-22 10:15:32 -07:00
myk002 3ff3457c10
include main test file as a module for testing
rewrite main.lua so it can be included as a module
rename test.lua to test_test.lua since I plan to rename main.lua to
test.lua in a future PR
2021-03-07 08:24:18 -08:00
myk002 4779dd678d
fix test_dir param and allow userdata in table_eq 2021-03-07 08:24:18 -08:00
myk002 f176310bcd
make table_eq check recursive equality
and add tests. to write test the table_eq function itself, I expose it
in the text env via expect_raw. if we don't want to do this,
alternatives could be:
1. add the test to main.lua itself
2. expose the expect.table_eq function via a test_hooks variable. then
   test.lua could require main.lua and access the function via the hook.
   may need to update main.lua a bit to ensure it does not run when it
   is "require"d
2021-03-07 08:24:17 -08:00
lethosor d3aeca495f
Set dfhack.internal.IN_TEST flag when running tests 2020-12-15 21:27:19 -05:00