Skip to content

Commit

Permalink
✅feat(swift): Tests added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeioth committed Feb 2, 2024
1 parent cd53332 commit 31170f8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/tests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dofile(tests_dir .. 'r.lua')
dofile(tests_dir .. 'ruby.lua')
dofile(tests_dir .. 'rust.lua')
dofile(tests_dir .. 'sh.lua')
dofile(tests_dir .. 'swift.lua')
dofile(tests_dir .. 'typescript.lua')
dofile(tests_dir .. 'vb.lua')
dofile(tests_dir .. 'zig.lua')
Expand Down
30 changes: 30 additions & 0 deletions tests/tests/languages/swift.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
--- This test file run all supported cases of use.
--- @usage :luafile ~/.local/share/nvim/lazy/compiler.nvim/tests/tests/languages/swift.lua

local ms = 1000 -- wait time
local language = require("compiler.languages.swift")
local example = vim.fn.stdpath "data" .. "/lazy/compiler.nvim/tests/examples/languages/swift/"

-- Build and run
vim.api.nvim_set_current_dir(example .. "build-and-run/")
language.action("option1")
vim.wait(ms)

-- Build
vim.api.nvim_set_current_dir(example .. "build/")
language.action("option2")
vim.wait(ms)

-- Run
language.action("option3")
vim.wait(ms)

-- Build solution (without .solution file)
vim.api.nvim_set_current_dir(example .. "solution-nofile/")
language.action("option4")
vim.wait(ms)

-- Build solution
vim.api.nvim_set_current_dir(example .. "solution/")
language.action("option4")
vim.wait(ms)

0 comments on commit 31170f8

Please sign in to comment.