-
-
Notifications
You must be signed in to change notification settings - Fork 619
chore: POC plenary test #3063
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
chore: POC plenary test #3063
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9ac1e05
chore: plenary tests POC
alex-courtis 2dcf249
chore: plenary tests POC
alex-courtis f9dc294
chore: plenary tests POC: harden directories
alex-courtis 63cd226
chore: plenary tests POC: add make entry, specify tests
alex-courtis 006b27d
chore: plenary tests POC: add make entry, specify tests
alex-courtis 91e6b97
chore: plenary tests POC: add make entry, specify tests
alex-courtis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
/luals-out/ | ||
/luals/ | ||
/plenary.nvim/ | ||
# backup vim files | ||
*~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# TODO add ability for user to specify a test file or directory | ||
|
||
REPO_DIR="$(git rev-parse --show-toplevel)" | ||
export REPO_DIR | ||
|
||
PLENARY_DIR="${REPO_DIR}/plenary.nvim" | ||
export PLENARY_DIR | ||
|
||
nvim --headless \ | ||
--clean \ | ||
--noplugin \ | ||
-u "tests/minimal_init.lua" \ | ||
-c "lua require('plenary.test_harness').test_directory('tests/', { minimal_init = './tests/minimal_init.lua' })" \ | ||
-c "qa!" | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
-- this file is necessary for the minimal_init option which directs the spawned nvim test instances be run with --noplugin | ||
|
||
-- ensure that this nvim-tree is not overridden by installed versions in .local/share/nvim/site etc. | ||
vim.o.runtimepath = vim.env.REPO_DIR .. "," .. vim.o.runtimepath | ||
|
||
-- plenary will append ,.,$HOME/src/nvim-tree/master/plenary.nvim in the spawned test instances, however we want this here to prevent overrides | ||
vim.o.runtimepath = vim.env.PLENARY_DIR .. "," .. vim.o.runtimepath | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
---@type Luassert | ||
local assert = require("luassert") | ||
local stub = require("luassert.stub") | ||
|
||
local utils = require("nvim-tree.utils") | ||
|
||
describe("utils.path_add_trailing", function() | ||
before_each(function() | ||
end) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intended? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops... didn't need that one... |
||
|
||
it("trailing added", function() | ||
assert.equals("foo/", utils.path_add_trailing("foo")) | ||
end) | ||
|
||
it("trailing already present", function() | ||
assert.equals("foo/", utils.path_add_trailing("foo/")) | ||
end) | ||
end) | ||
|
||
describe("utils.canonical_path", function() | ||
|
||
before_each(function() | ||
stub(vim.fn, "has") | ||
end) | ||
|
||
after_each(function() | ||
end) | ||
|
||
it("is windows", function() | ||
vim.fn.has.on_call_with("win32unix").returns(1) | ||
assert.equals("C:\\foo\\bar", utils.canonical_path("c:\\foo\\bar"), "should be uppercase drive") | ||
end) | ||
|
||
it("not windows", function() | ||
assert.equals("c:\\foo\\bar", utils.canonical_path("c:\\foo\\bar")) | ||
end) | ||
end) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a command in Makefile (e.g.
make test
) that runs this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. It can then run in CI.