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

In case of a mismatch, insert Left entries before Right #4

Closed
utkarshkukreti opened this issue Dec 25, 2015 · 0 comments
Closed

In case of a mismatch, insert Left entries before Right #4

utkarshkukreti opened this issue Dec 25, 2015 · 0 comments

Comments

@utkarshkukreti
Copy link
Owner

These should pass:

test "#4" {
    assert_eq!(::diff::slice(&[1], &[2]), vec![::diff::Result::Left(&1),
                                               ::diff::Result::Right(&2)]);
    assert_eq!(::diff::lines("a", "b"), vec![::diff::Result::Left("a"),
                                             ::diff::Result::Right("b")]);
}

but they fail with:

thread 'speculate::_::bugs::#4' panicked at 'assertion failed: (left == right) (left: [Right(2), Left(1)], right: [Left(1), Right(2)])', tests/tests.rs:53

and

thread 'speculate::_::bugs::#4' panicked at 'assertion failed: (left == right) (left: [Right("b"), Left("a")], right: [Left("a"), Right("b")])', tests/tests.rs:53

This will probably fix rust-lang/rustfmt#606 too.

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

No branches or pull requests

1 participant