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

Show failure location in summary #208

Closed
joshka opened this issue Sep 19, 2024 · 5 comments · Fixed by #211
Closed

Show failure location in summary #208

joshka opened this issue Sep 19, 2024 · 5 comments · Fixed by #211

Comments

@joshka
Copy link
Contributor

joshka commented Sep 19, 2024

It would be nice to be able to keep the file location in the summary view so that it's easy to jump to the location of the failing test (I often run tests in VSCode terminal, which accepts Cmd+Click to jump to a line of code)

Normal view

 1  failed: tests::test1
 thread 'tests::test1' panicked at src/lib.rs:123:9:
 assertion failed: false

Summary view

 1  failed: tests::automatically
@Canop
Copy link
Owner

Canop commented Sep 19, 2024

This looks like a bug that I don't reproduce right now: in my test the location line is correctly recognized and displayed in summary mode.

Can you please provide a test case ?

(also please check you have the last version)

@joshka
Copy link
Contributor Author

joshka commented Sep 19, 2024

I installed the latest available version just now:

❯ bacon --version
bacon 2.21.0

cargo new bacon-test --lib

#[cfg(test)]
mod tests {

    #[test]
    fn test1() {
        assert!(false);
    }
}

default:
image

Press s for summary:
image

@joshka
Copy link
Contributor Author

joshka commented Sep 19, 2024

In case it wasn't clear, by file location, I meant src/lib.rs:6:9, not tests:test1 as the latter does not (yet) work with vscode / rust-analyzer to navigate to tests. Also this is a nice to have / papercut type issue, not a breaking the world type one.

@Canop
Copy link
Owner

Canop commented Sep 19, 2024

Thanks, I reproduce. And indeed it's not a location line (as defined in the bacon model) so not really a bug, but something I hadn't thought about.

I'll have a look.

@Canop
Copy link
Owner

Canop commented Sep 27, 2024

This should be good with #211

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

Successfully merging a pull request may close this issue.

2 participants