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

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

Open
xiyuzhai opened this issue Nov 1, 2024 · 0 comments
Open

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

xiyuzhai opened this issue Nov 1, 2024 · 0 comments

Comments

@xiyuzhai
Copy link

xiyuzhai commented Nov 1, 2024

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.

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

No branches or pull requests

1 participant