Skip to content

Fix invocation of JSON Schema library and probability check bug#22

Merged
lupino3 merged 8 commits intomasterfrom
fix/build
Jun 11, 2020
Merged

Fix invocation of JSON Schema library and probability check bug#22
lupino3 merged 8 commits intomasterfrom
fix/build

Conversation

@lupino3
Copy link
Copy Markdown
Member

@lupino3 lupino3 commented Jun 10, 2020

No description provided.

lupino3 added 5 commits June 11, 2020 11:34
I don't understand how this used to work.

I assume the library broke backwards compatibility at some point.
Something changed in Pester 5 and this is causing issues in CI.
lupino3 added 3 commits June 11, 2020 18:12
For some reason, it looks like the NJsonSchema library exports a
NJsonSchema object if queried from .NET Core, but if queried
from .NET Framework (Windows PowerShell) it exports a
NJsonSchema4 object. From the same DLL.

This is a workaround to fallback to NJsonSchema4 if NJsonSchema
doesn't seem available, which makes the library work for
Windows PowerShell.
There is a 1/100 chance that a probability check with probability 0
would give the wrong result, because if the random number is 0 the old
code would check if 0 > 0, which is of course false.

Change the test to ≥ to account for this corner case.

Fixes #18.
@lupino3 lupino3 changed the title Fix invocation of JSON Schema library Fix invocation of JSON Schema library and probability check bug Jun 11, 2020
@lupino3 lupino3 merged commit 3885c7a into master Jun 11, 2020
@lupino3 lupino3 deleted the fix/build branch November 9, 2023 13:26
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.

1 participant