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

Structural equality fail #78

Closed
CraigStuntz opened this issue Nov 18, 2015 · 7 comments
Closed

Structural equality fail #78

CraigStuntz opened this issue Nov 18, 2015 · 7 comments
Milestone

Comments

@CraigStuntz
Copy link

This trivial test won't pass:

    [<Test>]
    member this.``structural equality``() =
        let actualList: char list = []
        [(actualList, "")] |> should equal [([], "")]

It fails with the interesting error:

Expected: [([], "")],
but was [([], "")]

However, it works correctly in FSI:

> let actualList: char list = [];;
   val actualList : char list = []
> [(actualList, "")] = [([], "")];;
   val it : bool = true
@sergey-tihon
Copy link
Member

What unit testing framework do you use? NUnit?

@CraigStuntz
Copy link
Author

Yes, that's NUnit. FsUnit appears to delegate equality to NUnit, which runs it through this horror show. It would probably be better if FsUnit did something closer to @forki's version.

@sergey-tihon
Copy link
Member

Look like similar to this #21

@CraigStuntz
Copy link
Author

It is certainly close to this comment on that issue, but implementing #21 won't fix the difference in behavior of should equal. I'm thinking that x |> should equal y and x = y should be isomorphic.

sergey-tihon added a commit to sergey-tihon/FsUnit that referenced this issue Feb 8, 2016
@sergey-tihon
Copy link
Member

We should track discussion on NUnit repo
FsUnit.Typed should not has this issue.

@rprouse
Copy link

rprouse commented Feb 8, 2016

The NUnit team would appreciate comments and ideas on nunit/nunit#1249. Change will happen if we can come up with a way forward without breaking existing unit tests. As @sergey-tihon says, I don't think this is an FsUnit issue, but that of the underlying framework, NUnit 😄

@sergey-tihon sergey-tihon added this to the Typed FsUnit milestone Feb 29, 2016
@sergey-tihon
Copy link
Member

Released in v2.2.0-beta1

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

3 participants