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 a unit test that checks that the returned FSharpProjectOptions graph doesn't contain duplicates #159

Merged

Conversation

safesparrow
Copy link
Contributor

@safesparrow safesparrow commented Aug 4, 2022

...as a proxy for checking that every project is mapped once and cached.

Test creates a "dense" graph:

  • 4 layers, 2 projects in each layer
  • Projects in each layer reference both projects from the previous layer

It then calls mapManyOptions and asserts that the returned graph of FSharpProjectOptions contains no duplicates ie. objects are reused.

Test results

When I removed the caching on the branch, the result was:

[23:12:19 ERR] Main tests.When creating FCS options, caches them failed in 00:00:07.4900000.
Mapping should reuse instances of FSharpProjectOptions and only create one per project.
expected: 8
  actual: 52
...
Failed:   1
        Main tests.When creating FCS options, caches them
Errored:  0 <Expecto>

When caching is enabled, test passes:

Failed:   0
Errored:  0 <Expecto>

…ce per project as a proxy for checking that every project is mapped once
@safesparrow safesparrow marked this pull request as ready for review August 4, 2022 22:16
@baronfel baronfel merged commit 25025a1 into ionide:map-many-fcs-options Aug 4, 2022
@safesparrow safesparrow deleted the map-many-fcs-options-update branch August 4, 2022 22:40
baronfel added a commit that referenced this pull request Aug 4, 2022
…nce (#156)

* add a way to efficiently map many project options to FCS options at once

* Add a unit test that checks that the returned FSharpProjectOptions graph doesn't contain duplicates (#159)

* Add a unit test for checking that FSharpProjectOptions are created once per project as a proxy for checking that every project is mapped once

* Fix test

Co-authored-by: Janusz Wrobel <janusz.wrobel.2@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants