2022-08-06 09:02:29 +00:00
|
|
|
local libivy = require "ivy.libivy"
|
|
|
|
|
|
|
|
|
|
it("should run a simple match", function(t)
|
|
|
|
|
local score = libivy.ivy_match("term", "I am a serch term")
|
|
|
|
|
|
2022-08-13 15:43:15 +00:00
|
|
|
if score <= 0 then
|
|
|
|
|
t.error("Score should not be less than 0 found " .. score)
|
2022-08-06 09:02:29 +00:00
|
|
|
end
|
|
|
|
|
end)
|
2022-09-04 12:10:11 +00:00
|
|
|
|
2022-09-04 15:13:02 +00:00
|
|
|
it("should find a dot file", function(t)
|
2022-09-04 12:10:11 +00:00
|
|
|
local current_dir = libivy.ivy_cwd()
|
2022-09-04 15:13:02 +00:00
|
|
|
local matches = libivy.ivy_files("ci.yml", current_dir)
|
2022-09-04 12:10:11 +00:00
|
|
|
|
|
|
|
|
if matches ~= ".github/workflows/ci.yml\n" then
|
|
|
|
|
t.error("Invalid matches: " .. matches)
|
|
|
|
|
end
|
2022-09-04 15:13:02 +00:00
|
|
|
end)
|