diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-21 22:30:40 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-23 04:33:35 -0300 |
commit | 79bd1739d8ca004ddd0b2fa5e24da4a6f4b776fa (patch) | |
tree | b8ead4801340bd958fccbcb97c35cc7d463f2435 /spec/quick_spec.lua | |
parent | a75d447e10bb7842cdbed0bb494697ddd88fd455 (diff) | |
download | luarocks-79bd1739d8ca004ddd0b2fa5e24da4a6f4b776fa.tar.gz luarocks-79bd1739d8ca004ddd0b2fa5e24da4a6f4b776fa.tar.bz2 luarocks-79bd1739d8ca004ddd0b2fa5e24da4a6f4b776fa.zip |
tests: introduce quick tests
Diffstat (limited to 'spec/quick_spec.lua')
-rw-r--r-- | spec/quick_spec.lua | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/quick_spec.lua b/spec/quick_spec.lua new file mode 100644 index 00000000..8b8206cf --- /dev/null +++ b/spec/quick_spec.lua | |||
@@ -0,0 +1,20 @@ | |||
1 | local lfs = require("lfs") | ||
2 | local test_env = require("spec.util.test_env") | ||
3 | local quick = require("spec.util.quick") | ||
4 | |||
5 | describe("quick tests: #quick", function() | ||
6 | before_each(function() | ||
7 | test_env.setup_specs() | ||
8 | end) | ||
9 | |||
10 | local spec_quick = test_env.testing_paths.spec_dir .. "/quick" | ||
11 | for f in lfs.dir(spec_quick) do | ||
12 | if f:match("%.q$") then | ||
13 | local tests = quick.compile(spec_quick .. "/" .. f, getfenv and getfenv() or _ENV) | ||
14 | for _, t in ipairs(tests) do | ||
15 | it(t.name, t.fn) | ||
16 | end | ||
17 | end | ||
18 | end | ||
19 | end) | ||
20 | |||