build: rework ci tests to include windows (#3011)

This commit is contained in:
James Trew
2024-04-13 11:27:53 -04:00
committed by GitHub
parent 5a701e9990
commit 4d4ade7f2b
10 changed files with 67 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
-- Just skip on mac, it has flaky CI for some reason
if vim.fn.has "mac" == 1 then
if vim.fn.has "mac" == 1 or require("telescope.utils").iswin then
return
end

View File

@@ -1,7 +1,12 @@
local picker = require "telescope.pickers"
local Path = require "plenary.path"
local eq = assert.are.same
local function new_path(unix_path)
return Path:new(unpack(vim.split(unix_path, "/"))).filename
end
describe("telescope", function()
describe("Picker", function()
describe("window_dimensions", function()
@@ -84,8 +89,8 @@ describe("telescope", function()
it("sorts matches after last os sep better", function()
local sorter = require("telescope.sorters").get_fuzzy_file()
local better_match = sorter:score("aaa", { ordinal = "bbb/aaa" })
local worse_match = sorter:score("aaa", { ordinal = "aaa/bbb" })
local better_match = sorter:score("aaa", { ordinal = new_path "bbb/aaa" })
local worse_match = sorter:score("aaa", { ordinal = new_path "aaa/bbb" })
assert(better_match < worse_match, "Final match should be stronger")
end)
@@ -103,6 +108,7 @@ describe("telescope", function()
describe("fzy", function()
local sorter = require("telescope.sorters").get_fzy_sorter()
local function score(prompt, line)
line = new_path(line)
return sorter:score(prompt, { ordinal = line }, function(val)
return val
end, function()
@@ -171,7 +177,7 @@ describe("telescope", function()
end)
local function positions(prompt, line)
return sorter:highlighter(prompt, line)
return sorter:highlighter(prompt, new_path(line))
end
describe("positioning", function()