-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add typed aliases around Xunit #203
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Smaug123 !
@CaptnCodr what do you think?
We need to fix #204 before merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Smaug123 in F# we still need to list all *.fs
file in *.fsproj
(it does not happed automatically because order is matter)
You need to modify two files
https://github.com/fsprojects/FsUnit/blob/master/src/FsUnit.Xunit/FsUnit.Xunit.fsproj#L16
https://github.com/fsprojects/FsUnit/blob/master/tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj#L38
otherwise you code does not compile and will not be included in assembly
facepalm thanks - this is what happens when the tooling prevents me from building or using an IDE locally! |
(If someone who can actually build the thing could do this, that would be amazing - I think it's the work of five minutes to fix the tests with an IDE.) |
@Smaug123 Fake does not let you use build.sh but what does not work in IDE? |
Oh, I can run Paket without FAKE - of course! Sorry, I'm new to the FAKE/Paket ecosystem and hadn't really grokked that they were different tools. |
@sergey-tihon It's late at night for me so I'm mostly asleep, but I think this has uncovered an inconsistency between the XUnit and NUnit versions. NUnit How would you like to resolve it? The obvious answer would be to swap the equality in the CustomMatcher |
src/FsUnit.Xunit/FsUnitTyped.fs
Outdated
/// The equality instance on `expected` is used, if available. | ||
[<DebuggerStepThrough>] | ||
let shouldNotEqual<'a> (expected: 'a) (actual: 'a) = | ||
should not' (equal actual) expected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actual
and exoected
swapped here as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was what happened when I was trying to fix a failing test - but it turned out not to be because I'd got the arguments in the wrong order, but instead because of the inconsistent behaviour of should equal
between NUnit and Xunit.
I do not see inconsistency (at least for now), can you please explain it to me? FsUnit follow |
This test behaves differently in xUnit vs NUnit:
(but on master, that test is not present in the Xunit tests.) In xUnit, In NUnit, The semantics of the |
I'll put them in the right order again, document and raise a bug for the issue, and continue with this PR without considering changing the semantics. |
At long last, I now consider this PR to be ready. |
Looks good after corrections. |
I can make the changes, but just to check, you've requested no semantic differences? |
You also could probably use the Assert methods as in FsUnit.NUnit/FsUnitTyped.fs e.g.: I liked that way as it was in the first commits for short circuiting to xUnit. (not into CustomMatcher) |
@sergey-tihon Would you mind taking another look at this please? |
# Conflicts: # src/FsUnit.NUnit/FsUnit.fs # src/FsUnit.Xunit/CustomMatchers.fs
@Smaug123 may I ask you to update test? We unified behavior between NUnit and xUnit and always call equality check on |
In that case I need to swap the order of arguments to be inconsistent with Nunit, or make a breaking change to the semantics of |
@Smaug123 I believe that we already did |
Thank you @Smaug123 ! |
I'm flying totally blind here; FAKE doesn't work on Apple Silicon until fsprojects/FAKE#2626 is fixed, so I can't build. Relying on the pipelines for everything.