diff options
| author | adelon <22380201+adelon@users.noreply.github.com> | 2026-07-31 02:03:38 +0200 |
|---|---|---|
| committer | adelon <22380201+adelon@users.noreply.github.com> | 2026-07-31 02:03:38 +0200 |
| commit | 77c5751019b1528dd73a3dba1a83fbf127e43999 (patch) | |
| tree | b39ae51dfe85e82e36a5137808ced6808639371d /source/Test/Unit | |
| parent | 73cd3b206ac09d4a741532b53926f9d1d94105b8 (diff) | |
Validate module artifact roots
Diffstat (limited to 'source/Test/Unit')
| -rw-r--r-- | source/Test/Unit/Semantic.hs | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/source/Test/Unit/Semantic.hs b/source/Test/Unit/Semantic.hs index b890de4..44d871b 100644 --- a/source/Test/Unit/Semantic.hs +++ b/source/Test/Unit/Semantic.hs @@ -202,23 +202,49 @@ keysExactInputs = do parsedModuleId firstParsedKey "parsed" secondParsed = parsedModuleId secondParsedKey "parsed" - firstArtifact = - Semantic.moduleArtifactId - (Semantic.moduleArtifactKey - (fixtureOwner fixture) - firstParsed - [] - (fixtureTheory fixture)) + firstArtifactKey <- expectRight + (Semantic.moduleArtifactKey + (fixtureOwner fixture) + firstParsed + [] + (fixtureTheory fixture)) + secondArtifactKey <- expectRight + (Semantic.moduleArtifactKey + (fixtureOwner fixture) + secondParsed + [] + (fixtureTheory fixture)) + let firstArtifact = + Semantic.moduleArtifactId firstArtifactKey secondArtifact = - Semantic.moduleArtifactId - (Semantic.moduleArtifactKey - (fixtureOwner fixture) - secondParsed - [] - (fixtureTheory fixture)) + Semantic.moduleArtifactId secondArtifactKey assertBool "module artifact binds parsed source identity" (firstArtifact /= secondArtifact) + assertEqual + "module artifact key cache round trip" + (Right firstArtifactKey) + (decodeCache + Semantic.getModuleArtifactKeyCache + (encodeCache + (Semantic.putModuleArtifactKeyCache + firstArtifactKey))) + syntax <- makeSyntax "artifact" + let artifactResult = + Semantic.moduleArtifactResult + firstArtifactKey + (Syntax.moduleSyntaxAssertedId syntax) + (Semantic.semanticInterfaceAssertedId + (fixtureInterface fixture)) + assertEqual + "module artifact root round trip" + (Right artifactResult) + (decodeCache + (Semantic.getModuleArtifactResultCache + firstArtifact) + (encodeCache + (Semantic.putModuleArtifactResultCache + artifactResult))) data Fixture = Fixture |
