Skip to content

bug: can't assert_eq against "\n" #52

Open
@xiyuzhai

Description

@xiyuzhai

update expect wouldn't result in a valid expect for just one single line.

#[test]
fn it_doesnt_work() {
    use expect_test::expect;
    use expect_test::Expect;

    fn t(expect: &Expect) {
        expect.assert_eq("\n")
    }
    t(&expect![[r#"

    "#]]);
}

Basically, when UPDATE_EXPECT=1 cargo test, the tests would pass. But then without the env, cargo test would fail.

See https://github.com/xiyuzhai/expect-test-bug for a minimal example.

Run

make test

to get the error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions