Skip to content

Conversation

@ThorstenReichert
Copy link
Contributor

Contributes to #7075.


CompilerAssert.RunScriptWithOptions [| "--langversion:preview" |]
"""
let assertEqual a b =
Copy link
Contributor

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?

Copy link
Contributor Author

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)).

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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

Copy link
Contributor

@KevinRansom KevinRansom left a 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

@KevinRansom KevinRansom requested a review from vzarytovskii June 12, 2020 23:59
@cartermp cartermp merged commit 4dd0741 into dotnet:master Jun 13, 2020
@ThorstenReichert ThorstenReichert deleted the MigrateFsharpQA branch June 13, 2020 00:14
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
…nit (dotnet#9435)

* Migrated comparison FSI test case

* Migrated string format FSI test case
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

Successfully merging this pull request may close these issues.

3 participants