Skip to content

Test panic locations can be outside test functions #40

@mightyiam

Description

@mightyiam

Here is an example of a test failure I'm seeing on b9b27e0 (main).

thread 'simple_straightline_remote_branch' (1047578) panicked at tests/basic.rs:537:35:
called `Result::unwrap()` on an `Err` value: OutputError { cmd: Some("cd \"/tmp/.tmphrIvID\" && \"git\" \"remote\" \"add\" \"origin\" \"/tmp/.tmpE5EgY4\""), stdin: None, cause: Expected(Output { output: Output { status: ExitStatus(unix_wait_status(768)), stdout: "", stderr: "error: remote origin already exists.\n" } }) }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

tests/basic.rs:537:35 is an unwrap inside a test helper. So to see the line that I am actually looking for, I may need a backtrace. An alternative is that test helpers return Result which is unwrapped in the test functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions