Comments (11)
Sounds good. We had it originally was not working good. Too much bloat sums it up great. Got replaced here: #31
Can't wait for your draft :) Note you might have to rebase. I just did some bug fixing yesterday. 116aedc
from plenary.nvim.
Yeah the test result output could be slicker.
Here a dump from my end:
Scheduling: /Users/MateoPanadero/Repositories/factorsharp.nvim/lua/spec/solution_spec.lua
========================================
Testing: @/Users/MateoPanadero/Repositories/factorsharp.nvim/lua/spec/solution_spec.lua
�[31mFail�[0m || (get_parent_directory_path(path)) : Returns the path to the parent directory for *nix systems
...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:12: Expected objects to be equal.
Passed in:
(string) 'a/b/c'
Expected:
(string) 'a/b/d'
stack traceback:
...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:12: in function <...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:7>
�[31mFail�[0m || (get_parent_directory_path(path)) : Returns the path to the parent directory for Windows
./lua/solution.lua:7: attempt to perform arithmetic on local 'index_of_last_path_separator' (a nil value)
stack traceback:
./lua/solution.lua:7: in function 'get_parent_directory_path'
...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:19: in function <...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:14>
�[32mSuccess: �[0m 0
�[31mFailed : �[0m 2
�[31mErrors : �[0m 0
========================================
Tests Failed. Exit: 1
The failing spec:
local sut = require 'lua.solution'
describe("(get_parent_directory_path(path)) :", function()
describe("Returns the path to the parent directory", function()
it("for *nix systems", function()
local path = "a/b/c/"
local expected = "a/b/d"
assert.is_equal(expected, sut.get_parent_directory_path(path))
end)
it("for Windows", function()
local path = "a\\b\\c\\d"
local expected = "a\\b\\c"
assert.is_equal(expected, sut.get_parent_directory_path(path))
end)
end)
end)
from plenary.nvim.
@Mathijs-Bakker that looks good, I'd say path should be relative to current file so we can somehow attach gf to jump to the error.
Also perhaps
./factorsharp.nvim/lua/spec/solution_spec.lua:12
Expected objects to be equal:
Expected:
(string) 'a/b/d'
Received :
(string) 'a/b/c'
from plenary.nvim.
This is actual plugin behavior. I didn't do anything to it. It's just how it shows up on my end (MacOS).
In case of running the testfile itself - aka <Plug>PlenaryTestFile
- the whole path with filename is redundant. The stack trace is giving us that info.
Something like below is very readable... It's probably better to break the lines of the 'descriptions' and 'it's' to prevent long lines/sentences. And preserve readability.
Tests: 2, Success: 1, Fails, 1, Errors: 0
get_parent_directory_path(path) : (description)
Returns the path to the parent directory (it)
for *nix systems: (it)
Expected objects to be equal.
Passed in:
(string) 'a/b/c'
Expected:
(string) 'a/b/d'
Stack traceback:
...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:12:
in function <...Repositories/factorsharp.nvim/lua/spec/solution_spec.lua:7>
I don't know if it's really possible. As Busted generates the stdout?
from plenary.nvim.
Oh thats very readable. Yes everything (I think) is generated by plenery, e.g. checkout plenary.nvim/lua/luassert/languages/en.lua
you can play around there.
from plenary.nvim.
I'm currently addressing this... will submit a pr when ready.
from plenary.nvim.
😍
from plenary.nvim.
the wtf-rate is high on this one XD
will take a while
from plenary.nvim.
Did i underestimate the task? :) Or do you need any help?
from plenary.nvim.
I've resolved and passed the initial issue. But that's not enough for my ideas.
Want to achieve the output like Busted:
Which shouldn't (read: I expect to not) be a biggie...
Boy, I was wrong XD
Anyways... still have some more reading/refactoring to do, to grasp plenary.testharness. And it's dependencies.
Good part is that I saw some vim.api functions which I didn't knew the existence of. Which makes some Lua functions - that I wrote in other projects - redundant.
from plenary.nvim.
Ok, I have most things running...
Which means the visual dots...
And the failure and error output.
Just like 'vanilla' Busted.
I will do a 'draft' tomorrow.
@Conni2461 What's the reason to not implement the original Busted into this repo?
Too much bloat?
from plenary.nvim.
Related Issues (20)
- Feature Request: support code coverage report
- Failed to spawn process, ENOENT: no such file or directory
- Safely updating stringly typed option lists HOT 3
- [Feature Request] Propagate OS Errors on Make Directory and more.
- [Feature Request] Allow plenary.scandir to follow symbolic links
- exists() hangs when it should return false HOT 1
- Bug Plenary Path while normalize path in WINDOWS HOT 10
- :help plenary.path?
- [BUG] `plenary.scandir.scandir()` incorrectly matches patterns in gitignore
- plenary printing -0 instead of 0 HOT 2
- Bug(popup): creating a popup fails after `set nomodifiable` HOT 1
- Question about usage HOT 1
- Simple example for async
- Are some tests expected to Fail? HOT 1
- job:pid() returns function? HOT 1
- [Feat] `selene` linter support
- Unintentionally global variables stat and ret in async_lib?
- test_harness does not handle when exceptions are thrown in a spec HOT 1
- vim.tbl_islist deprecation HOT 1
- Plenary Callback issue in dependent plugin HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plenary.nvim.