feat(pbs): add array-backed Stack and circular Queue
This commit is contained in:
@@ -53,6 +53,8 @@ class CompilerProjectKnowledgeTest {
|
||||
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(result.references().stream().anyMatch(value -> value.id().equals("pbs:spec:sdk-stack-and-queue.md")));
|
||||
assertTrue(result.references().stream().anyMatch(value -> value.id().equals("pbs:example:game:1:src/stack-queue.pbs")));
|
||||
assertTrue(language.referenceIds().contains("pbs:quickstart"));
|
||||
assertFalse(result.limitations().stream().anyMatch(value -> value.contains("DOCUMENTATION_UNAVAILABLE")));
|
||||
assertFalse(Files.exists(root.resolve(".workspace")));
|
||||
|
||||
@@ -35,6 +35,8 @@ public final class InstalledKnowledgeProbe {
|
||||
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:spec:sdk-stack-and-queue.md")), "Missing installed Stack/Queue specification");
|
||||
check(docs.stream().anyMatch(r -> r.id().equals("pbs:example:game:1:src/stack-queue.pbs")), "Missing installed Stack/Queue 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) {
|
||||
@@ -97,12 +99,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","map","maps.pbs").entrySet()) {
|
||||
for(var example:java.util.Map.of("set","sets.pbs","hash","hashing.pbs","map","maps.pbs","stack-queue","stack-queue.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=switch(example.getKey()){case "set"->"setExample";case "map"->"mapsExample";default->"hashingExample";};
|
||||
String function=switch(example.getKey()){case "set"->"setExample";case "map"->"mapsExample";case "stack-queue"->"stackQueueExample";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(
|
||||
|
||||
@@ -18,6 +18,7 @@ class InstalledKnowledgeTest {
|
||||
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);
|
||||
assertTrue(log.contains("Installed stack-queue execution fixture generated"), log);
|
||||
}
|
||||
|
||||
@Test void installedCompilerAndSdkCarryTheSameVerifiedCatalog() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user