-
Notifications
You must be signed in to change notification settings - Fork 789
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
Moved fsharpqa/Libraries/Core/LanguagePrimitives FSI test cases to NUnit #9435
Conversation
|
||
CompilerAssert.RunScriptWithOptions [| "--langversion:preview" |] | ||
""" | ||
let assertEqual a b = |
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.
Is there some reason you didn't use Assert.areEqual?
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.
Partly following the example in #9396 (comment), partly because it seemed easier than importing NUnit into FSI (might well be, that I'm just not aware of an easy way)).
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.
Oh of course, the assertion is happening within the executing code, it is not verifying the results. That makes perfect sense. Indeed I just did exactly the same thing in a test I added last night.
@vzarytovskii , we should consider having some form of Assertions framework used from within the compiled sources. That would probably stop us from adding our own unique assertions every time we check-in new tests.
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.
@vzarytovskii , we should consider having some form of Assertions framework used from within the compiled sources. That would probably stop us from adding our own unique assertions every time we check-in new tests.
@KevinRansom, I was pondering the same for a little while. Is there any method to make functions available within such code snippets? Preferably a better one than string manipulation?
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.
@ThorstenReichert
We are running a compiler within the test, so we can simply have a library and ensure the test references it. That works for the compiler and for FSI.
/cc @vzarytovskii
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.
Thanks for taking care of this, it is super helpful.
Kevin
…nit (dotnet#9435) * Migrated comparison FSI test case * Migrated string format FSI test case
Contributes to #7075.