Skip to content
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

Source isn't displayed unless the assertion is named #1

Open
petdance opened this issue Jun 27, 2017 · 3 comments
Open

Source isn't displayed unless the assertion is named #1

petdance opened this issue Jun 27, 2017 · 3 comments
Labels

Comments

@petdance
Copy link

petdance commented Jun 27, 2017

$ cat foo.t
#!/var/perl/bin/perl

use warnings;
use strict;

use Test2::V0;
use Test2::Plugin::SourceDiag;

plan 2;

is( 'war', 'peace', 'Is war peace?' );

is( 'freedom', 'slavery' );

gives:

$ prove -v foo.t
[15:51:11] foo.t .. 
# Seeded srand with seed '20170627' from local date.
1..2
not ok 1 - Is war peace?
# Failure source code:
# ------------
# 11: is( 'war', 'peace', 'Is war peace?' );
# ------------
# Failed test 'Is war peace?'
# at foo.t line 11.
# +-----+----+-------+
# | GOT | OP | CHECK |
# +-----+----+-------+
# | war | eq | peace |
# +-----+----+-------+
not ok 2 - is( 'freedom', 'slavery' );
# Failed test 'is( 'freedom', 'slavery' );'
# at foo.t line 13.
# +---------+----+---------+
# | GOT     | OP | CHECK   |
# +---------+----+---------+
# | freedom | eq | slavery |
# +---------+----+---------+
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests 
[15:51:11]

Test Summary Report
-------------------
foo.t (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
Files=1, Tests=2,  0 wallclock secs ( 0.02 usr  0.01 sys +  0.14 cusr  0.01 csys =  0.18 CPU)
Result: FAIL
@petdance
Copy link
Author

I'm guessing this is related to the inject_name argument somehow.

@exodist
Copy link
Member

exodist commented Jun 27, 2017

IF the assertion is not named then the source becomes the name.

I am open to this not being a good idea.

@petdance
Copy link
Author

Aha, now I understand.

I'm not sure if that's a good idea or not. I can see both sides. Hmm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants