ionide / proj-info

Parse and evaluate MsBuild project files
MIT License
64 stars 37 forks source link

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

Closed safesparrow closed 2 years ago

safesparrow commented 2 years ago

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

Test creates a "dense" graph:

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>