aliou / bats.vim Goto Github PK
View Code? Open in Web Editor NEWSyntax files for Bats (Bash Automated Testing System).
Syntax files for Bats (Bash Automated Testing System).
I'm on bats 1.2.1 and the latest bats.vim.
With example test output such as this:
bats test/blah.bats
1..2
not ok 1 blah test
# (from function `assert_equal' in file test/test_helper/bats-assert/src/assert_equal.bash, line 40,
# in test file test/blah.bats, line 14)
# `assert_equal "$output" "foo: no such file 'nonexistent_filename'"' failed
#
# -- values do not equal --
# expected : foo: no such file 'nonexistent_filename'
# actual :
# --
#
In the quickfix window I see only this:
1 successful test
It looks like maybe the output of bats has changed a little so the current errorformat is not picking everything up any more? Specifically in my example the file and line are in parenthesis but split over two lines which seems to be the problem. Also error msgs seem to have one space after the #
rather than two now.
If I tweak the errorformat in bats.vim to this:
let s:errorformat = join([
\ '%Enot ok %m',
\ '%-C#%.%#in test file %f\\, line %l)',
\ '%-C# (from func%.%#',
\ '%-C# %m',
\ '%-G%.%#',
\ '%Z'
\ ], ',')
I get what I would have expected:
test/blah.bats|14 error| 1 successful test `assert_equal "$output" "foo: no such file 'nonexistent_filename'"' failed
It works in my case and I can submit this as a PR if it makes sense.
:h ofu
bats.vim/after/syntax/bats.vim
Line 12 in 64982ad
:help CompilerSet
:help errorformat
See existing.
I'm on bats 1.2.1 and the latest bats.vim.
With example test output such as this:
bats test/blah.bats
1..2
not ok 1 blah test
# (from function `assert_equal' in file test/test_helper/bats-assert/src/assert_equal.bash, line 40,
# in test file test/blah.bats, line 14)
# `assert_equal "$output" "foo: no such file 'nonexistent_filename'"' failed
#
# -- values do not equal --
# expected : foo: no such file 'nonexistent_filename'
# actual :
# --
#
In the quickfix window I see only this:
1 successful test
It looks like maybe the output of bats has changed a little so the current errorformat is not picking everything up any more? Specifically in my example the file and line are in parenthesis but split over two lines which seems to be the problem. Also error msgs seem to have one space after the #
rather than two now.
If I tweak the errorformat in bats.vim to this:
let s:errorformat = join([
\ '%Enot ok %m',
\ '%-C#%.%#in test file %f\\, line %l)',
\ '%-C# (from func%.%#',
\ '%-C# %m',
\ '%-G%.%#',
\ '%Z'
\ ], ',')
I get what I would have expected:
test/blah.bats|14 error| 1 successful test `assert_equal "$output" "foo: no such file 'nonexistent_filename'"' failed
It works in my case and I can submit this as a PR if it makes sense.
The filetype is being detected correctly, but executing :Make
(or :Dispatch from https://github.com/tpope/vim-dispatch) is still attempting to execute make
, not bats
.
:set makeprg
-> makeprg=make
Files starting with:
#!/usr/bin/env bats
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.