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

Add support for Expecto theory tests #1160

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

Numpsy
Copy link
Contributor

@Numpsy Numpsy commented Sep 5, 2023

WHAT

Add support for Expecto 'theory' tests

WHY

haf/expecto#445 (comment)

HOW

Added extra cases to the list (to begin with, see other comments)

@Numpsy
Copy link
Contributor Author

Numpsy commented Sep 5, 2023

As it stands, this change alone doesn't pick up the theory tests -

The issue seems to be that in visitExpr it picks up the new test cases, but then doesn't add it to the list of tests because the type of the expression is ArrayOrListComputed instead of one of the expected types:

image

I don't know enough about it to say how it should be changed - e.g. just add a | Case, SynExpr.ArrayOrListComputed to the logic? Add a Theory type to go along side Case and List and look for the Array parameter to that?

edit: or maybe it needs another | SynExpr.App case that matches the 3 parameters to the testTheory call more explicitly?


<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

testTheory is a feature of Expecto 10, which only supports .NET 6+, so I updated thise

@Krzysztof-Cieslak Krzysztof-Cieslak marked this pull request as ready for review September 5, 2023 20:10
Copy link
Member

@TheAngryByrd TheAngryByrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎸 Thank you!!

@TheAngryByrd TheAngryByrd merged commit e214ff4 into ionide:main Sep 6, 2023
6 of 9 checks passed
@Numpsy Numpsy deleted the rw/expecto_theory branch September 6, 2023 11:01
@TheAngryByrd
Copy link
Member

FYI I fixed the AST stuff in ad2e8ac because yeah that stuff can get gnarly.

@Numpsy
Copy link
Contributor Author

Numpsy commented Sep 7, 2023

Ok, VSCode is highlighting all my theory tests in the editor now with Ionide 7.11 :-)

nojaf pushed a commit to nojaf/FsAutoComplete that referenced this pull request Nov 3, 2023
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.

2 participants