Giter VIP home page Giter VIP logo

bats.vim's People

Contributors

aliou avatar davewongillies avatar ian2020 avatar kumarstack55 avatar mkalinski avatar tobinjt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bats.vim's Issues

Errorformat not picking up file, line and message

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.

Errorformat not picking up file, line and message

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.