feat(pbs): add Map and read-only Keyval associations
This commit is contained in:
@@ -51,6 +51,8 @@ class CompilerProjectKnowledgeTest {
|
||||
assertTrue(result.references().stream().anyMatch(value -> value.id().equals("pbs:example:game:1:src/collections.pbs")));
|
||||
assertTrue(result.references().stream().anyMatch(value -> value.id().equals("pbs:spec:sdk-linked-and-cursor.md")));
|
||||
assertTrue(result.references().stream().anyMatch(value -> value.id().equals("pbs:example:game:1:src/linked.pbs")));
|
||||
assertTrue(result.references().stream().anyMatch(value -> value.id().equals("pbs:spec:sdk-map-and-keyval.md")));
|
||||
assertTrue(result.references().stream().anyMatch(value -> value.id().equals("pbs:example:game:1:src/maps.pbs")));
|
||||
assertTrue(language.referenceIds().contains("pbs:quickstart"));
|
||||
assertFalse(result.limitations().stream().anyMatch(value -> value.contains("DOCUMENTATION_UNAVAILABLE")));
|
||||
assertFalse(Files.exists(root.resolve(".workspace")));
|
||||
|
||||
@@ -33,6 +33,8 @@ public final class InstalledKnowledgeProbe {
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/linked.pbs")), "Missing installed Linked example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:spec:sdk-set-and-identity.md")), "Missing installed Set/Identity specification");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/sets.pbs")), "Missing installed Set example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:spec:sdk-map-and-keyval.md")), "Missing installed Map/Keyval specification");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/maps.pbs")), "Missing installed Map/Keyval example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/hashing.pbs")), "Missing installed hashing example");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:sdk:game:1:sdk/hash/main.pbs")), "Missing installed hash SDK");
|
||||
for (var reference : docs) {
|
||||
@@ -95,12 +97,12 @@ public final class InstalledKnowledgeProbe {
|
||||
check(linkedResult.diagnostics().stream().noneMatch(issue->issue.isError()),"Installed Linked example must compile");
|
||||
Files.write(fixtures.resolve("pbs-linked-installed.pbx"),linkedResult.bytecodeBytes());
|
||||
System.out.println("Installed Linked execution fixture generated");
|
||||
for(var example:java.util.Map.of("set","sets.pbs","hash","hashing.pbs").entrySet()) {
|
||||
for(var example:java.util.Map.of("set","sets.pbs","hash","hashing.pbs","map","maps.pbs").entrySet()) {
|
||||
Path exampleRoot=Files.createDirectory(Path.of(example.getKey()+"-example")).toRealPath();
|
||||
Files.createDirectories(exampleRoot.resolve("src"));
|
||||
Files.copy(root.resolve("prometeu.json"),exampleRoot.resolve("prometeu.json"));
|
||||
Files.writeString(exampleRoot.resolve("src/mod.barrel"),"pub fn frame() -> void;");
|
||||
String function=example.getKey().equals("set")?"setExample":"hashingExample";
|
||||
String function=switch(example.getKey()){case "set"->"setExample";case "map"->"mapsExample";default->"hashingExample";};
|
||||
Files.writeString(exampleRoot.resolve("src/main.pbs"),Files.readString(root.resolve("src/"+example.getValue()))
|
||||
+"\n[Frame] fn frame()->void {if "+function+"()!=42 {let failure=1/0;}}");
|
||||
var exampleResult=BuilderPipelineService.INSTANCE.compile(
|
||||
|
||||
@@ -17,6 +17,7 @@ class InstalledKnowledgeTest {
|
||||
assertTrue(log.contains("Packaged external sources verified"), log);
|
||||
assertTrue(log.contains("Installed List/Cursor execution fixture generated"), log);
|
||||
assertTrue(log.contains("Installed Linked execution fixture generated"), log);
|
||||
assertTrue(log.contains("Installed map execution fixture generated"), log);
|
||||
}
|
||||
|
||||
@Test void installedCompilerAndSdkCarryTheSameVerifiedCatalog() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user