Skip to content

Commit b71824b

Browse files
committed
Feature: Add tests
- Add a test for kit scanning - Add a test that checks if the file is present and if the kits could be registered
1 parent a6602cd commit b71824b

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

scripts/scan_kits.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- scripts/scan_kits.lua
2+
package.path = package.path .. ";./lua/?.lua;./lua/?/init.lua"
3+
4+
local scanner = require("cmake-tools.scanner")
5+
6+
local function main()
7+
local kits = scanner.scan_for_kits()
8+
print(vim.inspect(kits)) -- Use simple print in standalone
9+
end
10+
11+
main()

tests/scanner_spec.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- tests/scanner_spec.lua
2+
describe("scanner", function()
3+
it("scan for kits", function()
4+
local scanner = require("cmake-tools.scanner")
5+
local kits = scanner.scan_for_kits()
6+
assert(#kits > 0)
7+
end)
8+
end)
9+
10+
describe("kits", function()
11+
it("parse from global file", function()
12+
local kit = require("cmake-tools.kits")
13+
local const = require("cmake-tools.const")
14+
local kits = kit.get(const.cmake_kits_path, vim.loop.cwd())
15+
assert(#kits > 0)
16+
end)
17+
end)

0 commit comments

Comments
 (0)