Skip to content

Commit f0a77e3

Browse files
committed
test(visits): make work on Windows
1 parent 53ac464 commit f0a77e3

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030

3131
env:
32-
FILE: tests/test_extra.lua
32+
FILE: tests/test_visits.lua
3333

3434
steps:
3535
- uses: actions/checkout@v4

tests/test_visits.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@ local edit = function(path) child.cmd('edit ' .. child.fn.fnameescape(path)) end
1717
-- Test paths helpers
1818
local join_path = function(...) return table.concat({ ... }, '/') end
1919

20-
local full_path = function(x)
21-
local res = child.fn.fnamemodify(x, ':p'):gsub('(.)/$', '%1')
22-
return res
23-
end
20+
local full_path = function(x) return (child.fn.fnamemodify(x, ':p'):gsub('\\', '/'):gsub('/+', '/'):gsub('(.)/$', '%1')) end
2421

2522
local test_dir = 'tests/dir-visits'
26-
local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('(.)/$', '%1')
23+
local test_dir_absolute = vim.fn.fnamemodify(test_dir, ':p'):gsub('\\', '/'):gsub('(.)/$', '%1')
2724

2825
local make_testpath = function(...) return join_path(test_dir_absolute, ...) end
2926

0 commit comments

Comments
 (0)