Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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