feat(studio): improve compiler reliability and AI diagnostics
Preserve structured diagnostics, source attribution, phase outcomes and revision context through compiler, Studio, LSP, MCP and JavaFX. Add project service discovery and resilient VS Code reconnection. Correct all eight reproduced PBS production failures in expression context, sibling executable bindings and nominal owner identity. Consolidate specs, lessons, immutable baseline evidence and the maintained source-to-guest qualification runner. Validation: required Gradle gate recorded 724 tests, with 711 passed and 13 skipped. Full corpus passed 168 compilation observations and 108 guest runs (104 successes and four deliberate faults); supplemental controls passed 42 compilations and 16 guest runs. TypeScript compilation, two Node discovery tests and discussion validation passed.
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
package p.studio.compiler.pbs;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import p.studio.compiler.pbs.ast.PbsAst;
|
||||
import p.studio.compiler.source.Span;
|
||||
import p.studio.compiler.source.identifiers.FileId;
|
||||
import p.studio.compiler.source.diagnostics.*;
|
||||
import p.studio.utilities.structures.ReadOnlyList;
|
||||
import java.util.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class GenericDiagnosticContextTest {
|
||||
@Test void specializationWrapperPreservesDetectorAndReportedPhase() {
|
||||
var span = new Span(new FileId(0), 0, 4);
|
||||
var declaration = new PbsAst.HostDecl("Fixture", ReadOnlyList.empty(), ReadOnlyList.empty(), span);
|
||||
var application = new PbsAst.ApplicationOrigin(declaration, ReadOnlyList.empty(), "fixture", "Fixture<int>", span);
|
||||
var original = DiagnosticDescriptions.attach(new Diagnostic(Severity.Error, "E_SEM_UNSUPPORTED_LOWERING", "failed", span, List.of()),
|
||||
"pbs.lowering.call-resolution", Map.of("requestedSymbol", "probe", "argumentCount", 0), FailureKind.PROGRAM_REJECTION);
|
||||
var sink = DiagnosticSink.empty(); PbsGenericDiagnostics.forOrigin(application, sink).report(original);
|
||||
var output = sink.asCollection().iterator().next();
|
||||
assertEquals(original.getContext(), output.getContext()); assertEquals(original.getReportedPhase(), output.getReportedPhase());
|
||||
assertEquals(original.getCode(), output.getCode()); assertEquals(2, output.getRelated().size());
|
||||
assertTrue(output.getMessage().contains("Fixture<int>"));
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package p.studio.compiler.pbs.lowering;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import p.studio.AppMode;
|
||||
import p.studio.compiler.models.*;
|
||||
import p.studio.compiler.messages.FrontendPhaseContext;
|
||||
import p.studio.compiler.services.PBSFrontendPhaseService;
|
||||
import p.studio.compiler.pbs.ast.PbsAst;
|
||||
import p.studio.compiler.pbs.lexer.PbsLexer;
|
||||
import p.studio.compiler.pbs.parser.PbsParser;
|
||||
import p.studio.compiler.source.Span;
|
||||
import p.studio.compiler.source.tables.*;
|
||||
import p.studio.compiler.source.diagnostics.DiagnosticSink;
|
||||
import p.studio.compiler.utilities.SourceProviderFactory;
|
||||
import p.studio.utilities.structures.ReadOnlyList;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class PbsNominalOwnerRegressionTest {
|
||||
@TempDir Path temporary;
|
||||
@Test void declarationScopeAndSyntheticReceiverHaveDistinctResolutionEvidence() throws Exception {
|
||||
var json=new ObjectMapper();var reports=new ArrayList<Map<String,Object>>();
|
||||
var cases=json.readTree(getClass().getResourceAsStream("/production-regressions/cases.json")).path("cases");
|
||||
for(var example:cases) {
|
||||
String id=example.path("id").asText();
|
||||
if(!Set.of("F4-distinct","F4-same-no-dependency","F4-same-dependency","F4-rename-a").contains(id))continue;
|
||||
var root=Files.createDirectory(temporary.resolve(id)).toRealPath();var projects=new ProjectTable();var files=new FileTable(1);
|
||||
var project=projects.register(ProjectDescriptor.builder().rootPath(root).name("caseapp").version("1").sourceRoots(ReadOnlyList.from(root.resolve("src"))).build());
|
||||
var entries=example.path("files").fields();p.studio.compiler.source.identifiers.FileId main=null;
|
||||
while(entries.hasNext()) {
|
||||
var entry=entries.next();var path=root.resolve(entry.getKey());Files.createDirectories(path.getParent());Files.writeString(path,entry.getValue().asText());
|
||||
if(entry.getKey().endsWith(".pbs")||entry.getKey().endsWith(".barrel")) {
|
||||
var file=files.register(new SourceHandle(project,root.relativize(path),path,Files.size(path),0,SourceProviderFactory.filesystem()));
|
||||
if(entry.getKey().equals("src/a/main.pbs"))main=file;
|
||||
}
|
||||
}
|
||||
assertNotNull(main);
|
||||
var context=new FrontendPhaseContext(projects,files,new BuildStack(ReadOnlyList.from(project)),1,AppMode.Game);
|
||||
var supplemental=PBSFrontendPhaseService.importedSupplementalTopDeclsByFile(context,DiagnosticSink.empty(),p.studio.compiler.messages.BuildingIssueSink.empty()).get(main);
|
||||
var diagnostics=DiagnosticSink.empty();var ast=PbsParser.parse(PbsLexer.lex(files.get(main).readUtf8().orElseThrow(),main,diagnostics),main,diagnostics);
|
||||
var types=new PbsRuntimeTypes(ast,supplemental,Map.of());
|
||||
var global=(PbsAst.GlobalDecl)ast.topDecls().stream().filter(d->d instanceof PbsAst.GlobalDecl).findFirst().orElseThrow();
|
||||
var declaration=types.contractTypes.declaration(global.explicitType());assertNotNull(declaration);
|
||||
var flattened=types.structs.get(global.explicitType().name());assertNotNull(flattened);
|
||||
assertEquals(declaration.span(), types.struct(global.explicitType()).span());
|
||||
assertEquals(types.key(global.explicitType()), types.key(PbsRuntimeTypes.type(global.explicitType().name())));
|
||||
reports.add(Map.of("case",id,"source",root.relativize(files.get(declaration.span().getFileId()).getCanonPath()).toString(),
|
||||
"flatOwnerSource",root.relativize(files.get(flattened.span().getFileId()).getCanonPath()).toString(),
|
||||
"declaredReceiverKey",types.key(global.explicitType()),"syntheticReceiverKey",types.key(PbsRuntimeTypes.type(global.explicitType().name())),
|
||||
"flatOwnerMatches",declaration.span().equals(flattened.span())));
|
||||
}
|
||||
var directory=Path.of("build/production-regressions");Files.createDirectories(directory);
|
||||
json.writerWithDefaultPrettyPrinter().writeValue(Files.createTempFile(directory,"nominal-trace-",".json").toFile(),reports);
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package p.studio.compiler.services;
|
||||
|
||||
import com.fasterxml.jackson.databind.*;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
import p.studio.AppMode;
|
||||
import p.studio.compiler.messages.*;
|
||||
import p.studio.compiler.models.*;
|
||||
import p.studio.compiler.source.tables.*;
|
||||
import p.studio.compiler.utilities.SourceProviderFactory;
|
||||
import p.studio.compiler.source.diagnostics.*;
|
||||
import p.studio.utilities.logs.LogAggregator;
|
||||
import p.studio.utilities.structures.ReadOnlyList;
|
||||
import java.nio.file.*;
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
class PbsProductionLoweringRegressionTest {
|
||||
@TempDir Path root;
|
||||
static Stream<String> cases() throws Exception {
|
||||
try(var input=PbsProductionLoweringRegressionTest.class.getResourceAsStream("/production-regressions/cases.json")) {
|
||||
byte[] corpus=input.readAllBytes();
|
||||
assertEquals("0ad291942af21e990f5cae3348a5be368dee865aa2843ba0d0effd1a9136cb87",
|
||||
HexFormat.of().formatHex(java.security.MessageDigest.getInstance("SHA-256").digest(corpus)));
|
||||
return new ObjectMapper().readTree(corpus).path("cases").findValuesAsText("id").stream();
|
||||
}
|
||||
}
|
||||
@ParameterizedTest(name="{0}") @MethodSource("cases")
|
||||
void originalCorpusKeepsSourceAndExpectedFrontendResult(String id) throws Exception {
|
||||
var corpus=new ObjectMapper().readTree(getClass().getResourceAsStream("/production-regressions/cases.json"));
|
||||
JsonNode example=null; for(var c:corpus.path("cases"))if(c.path("id").asText().equals(id))example=c;
|
||||
assertNotNull(example); checkCase(example);
|
||||
}
|
||||
static Stream<String> focusedCases() throws Exception {
|
||||
return new ObjectMapper().readTree(PbsProductionLoweringRegressionTest.class.getResourceAsStream("/production-regressions/focused-cases.json")).path("cases").findValuesAsText("id").stream();
|
||||
}
|
||||
@ParameterizedTest(name="{0}") @MethodSource("focusedCases")
|
||||
void focusedContextVisibilityAndSharedIdentity(String id) throws Exception {
|
||||
var examples=new ObjectMapper().readTree(getClass().getResourceAsStream("/production-regressions/focused-cases.json")).path("cases");
|
||||
for(var example:examples)if(example.path("id").asText().equals(id)){checkCase(example);return;}
|
||||
fail("Unknown focused case "+id);
|
||||
}
|
||||
void checkCase(JsonNode example) throws Exception {
|
||||
var id=example.path("id").asText(); var files=new LinkedHashMap<String,String>();
|
||||
var entries=example.path("files").fields();while(entries.hasNext()){var entry=entries.next();files.put(entry.getKey(),entry.getValue().asText());}
|
||||
var result=compile(files);
|
||||
assertEquals(example.path("expectedCompile").asText().equals("rejected"),result.diagnostics().hasErrors(),id+": "+result.diagnostics().asCollection());
|
||||
if(id.equals("F3-global"))assertEquals(1,result.backend().getGlobals().stream().filter(g->g.name().equals("count")).count());
|
||||
for(var entry:files.entrySet())assertEquals(entry.getValue(),Files.readString(root.resolve(entry.getKey())));
|
||||
}
|
||||
@Test void expectedReturnOverloadsRemainContextual() throws Exception {
|
||||
var result=compile(Map.of("src/mod.barrel","pub fn frame() -> void;\n", "src/main.pbs", """
|
||||
declare struct Probe() { fn value() -> int { return 1; } fn value() -> bool { return true; } }
|
||||
declare global data: Probe = new Probe();
|
||||
fn check() -> bool { return data.value(); }
|
||||
[Frame] fn frame() -> void { let number: int=data.value(); let flag: bool=data.value(); if !check() || !flag || number!=1 { let failure=1/0; } }
|
||||
"""));
|
||||
assertFalse(result.diagnostics().hasErrors(), result.diagnostics().asCollection().toString());
|
||||
}
|
||||
record Compiled(IRBackend backend, DiagnosticSink diagnostics) {}
|
||||
Compiled compile(Map<String,String> sources) throws Exception {
|
||||
root=root.toRealPath(); var projects=new ProjectTable();var files=new FileTable(1);
|
||||
var owner=projects.register(ProjectDescriptor.builder().rootPath(root).name("caseapp").version("1.0.0")
|
||||
.sourceRoots(ReadOnlyList.from(root.resolve("src"))).build());
|
||||
for(var entry:sources.entrySet()) {
|
||||
var path=root.resolve(entry.getKey());Files.createDirectories(path.getParent());Files.writeString(path,entry.getValue());
|
||||
if(entry.getKey().endsWith(".pbs")||entry.getKey().endsWith(".barrel"))files.register(new SourceHandle(owner,root.relativize(path),path,Files.size(path),0,SourceProviderFactory.filesystem()));
|
||||
}
|
||||
var diagnostics=DiagnosticSink.empty(); var backend=new PBSFrontendPhaseService().compile(
|
||||
new FrontendPhaseContext(projects,files,new BuildStack(ReadOnlyList.from(owner)),1,AppMode.Game),diagnostics,LogAggregator.empty(),BuildingIssueSink.empty());
|
||||
return new Compiled(backend,diagnostics);
|
||||
}
|
||||
}
|
||||
+451
@@ -0,0 +1,451 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"cases": [
|
||||
{
|
||||
"id": "F1-local",
|
||||
"family": "call-comparison-return",
|
||||
"description": "Control: method result materialized before comparison",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare struct Probe() { fn value() -> int { return 1; } }\ndeclare global data: Probe = new Probe();\nfn check() -> bool { let value=data.value(); return value!=0; }\n[Frame] fn frame() -> void { if !check() { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "35df5a71b9d508b20e8b293a769ba1397a3209d99246c39240e8788cda932990"
|
||||
},
|
||||
{
|
||||
"id": "F1-direct",
|
||||
"family": "call-comparison-return",
|
||||
"description": "Method call compared directly in returned expression",
|
||||
"control": "F1-local",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare struct Probe() { fn value() -> int { return 1; } }\ndeclare global data: Probe = new Probe();\nfn check() -> bool { return data.value()!=0; }\n[Frame] fn frame() -> void { if !check() { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "382223b4c520762a93e3ee767255175adec8b24f69949b335c1a0030c9d75e61"
|
||||
},
|
||||
{
|
||||
"id": "F1-two-calls",
|
||||
"family": "call-comparison-return",
|
||||
"description": "Two method calls as comparison operands",
|
||||
"control": "F1-local",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare struct Probe() { fn value() -> int { return 1; } }\ndeclare global data: Probe = new Probe();\nfn check() -> bool { return data.value()==data.value(); }\n[Frame] fn frame() -> void { if !check() { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "2e3da1c805c18b5cdc34ca372fae737804a9274205ef377ac21d5b0034d60c4f"
|
||||
},
|
||||
{
|
||||
"id": "F1-service-this",
|
||||
"family": "call-comparison-return",
|
||||
"description": "Service receiver this inside a returned comparison",
|
||||
"control": "F1-service-local",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare service Probe { fn value() -> int { return 1; } fn check() -> bool { return this.value()!=0; } }\n[Frame] fn frame() -> void { if !Probe.check() { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "78a7ba39a880d9136b49f82ecbee7d409333c26861ff0a6b429ae6a55f08d089"
|
||||
},
|
||||
{
|
||||
"id": "F1-service-local",
|
||||
"family": "call-comparison-return",
|
||||
"description": "Control: identical service call materialized before returned comparison",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare service Probe { fn value() -> int { return 1; } fn check() -> bool { let value=this.value(); return value!=0; } }\n[Frame] fn frame() -> void { if !Probe.check() { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "f07038dc6f42923a65b1df8c4d17aa61eb1714ae7907d82b87fcda9e6c4b73fb"
|
||||
},
|
||||
{
|
||||
"id": "F1-condition",
|
||||
"family": "call-comparison-return",
|
||||
"description": "Control: direct method comparison in an if condition",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare struct Probe() { fn value() -> int { return 1; } }\ndeclare global data: Probe = new Probe();\n[Frame] fn frame() -> void { if data.value()!=1 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "415d08d0155fc8e8b4e0df3c1eb47c0a6aa7bda6481fdc4f5024c14d0f70d014"
|
||||
},
|
||||
{
|
||||
"id": "F2-locals",
|
||||
"family": "nested-call-expression",
|
||||
"description": "Control: effectful call arguments stored in locals",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare global calls: int=0;\nfn next() -> int { calls+=1; return calls; }\nfn add(a: int,b: int) -> int { return a+b; }\n[Frame] fn frame() -> void { calls=0; let a=next(); let b=next(); let value=add(a,b); if value!=3 || calls!=2 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "1eb4dbd0bfa6fbc9e002793e6c23eefa80eb091d40ccf2253520b532b3420218"
|
||||
},
|
||||
{
|
||||
"id": "F2-arguments",
|
||||
"family": "nested-call-expression",
|
||||
"description": "Effectful call arguments evaluate once, left to right",
|
||||
"control": "F2-locals",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare global calls: int=0;\nfn next() -> int { calls+=1; return calls; }\nfn add(a: int,b: int) -> int { return a+b; }\n[Frame] fn frame() -> void { calls=0; let value=add(next(),next()); if value!=3 || calls!=2 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "b8713121ffe7afacdd9d4ad6046768ff4ad681b44fcc153f84a432f6df75717c"
|
||||
},
|
||||
{
|
||||
"id": "F2-expression",
|
||||
"family": "nested-call-expression",
|
||||
"description": "Effectful calls nested inside arithmetic argument",
|
||||
"control": "F2-locals",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare global calls: int=0;\nfn next() -> int { calls+=1; return calls; }\nfn add(a: int,b: int) -> int { return a+b; }\n[Frame] fn frame() -> void { calls=0; let value=add(next()+next(),next()); if value!=6 || calls!=3 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "c6ede06ecfad7bdd167b8f3afb849df362787484db1968f74b62c24909818073"
|
||||
},
|
||||
{
|
||||
"id": "F2-struct-method",
|
||||
"family": "nested-call-expression",
|
||||
"description": "Struct method used as another method argument",
|
||||
"control": "F2-locals",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare struct Probe() { fn value() -> int { return 1; } }\ndeclare global data: Probe = new Probe();\nfn add(a: int,b: int) -> int { return a+b; }\n[Frame] fn frame() -> void { let value=add(data.value(),data.value()); if value!=2 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "8ed2b002ef5c20f01ae09949dc0ae75c574cce782dbe27bd304b25fa94045894"
|
||||
},
|
||||
{
|
||||
"id": "F3-single-file",
|
||||
"family": "same-module-files",
|
||||
"description": "Control: function and caller in the same file",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "fn increment(value: int) -> int { return value+1; }\n[Frame] fn frame() -> void { let value=increment(2); if value!=3 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "aff9dbc6f5e3b67b713da29e7e20eb97913464bedcc5f858964ec110ed7b8c4a"
|
||||
},
|
||||
{
|
||||
"id": "F3-function",
|
||||
"family": "same-module-files",
|
||||
"description": "mod function called from another file",
|
||||
"control": "F3-single-file",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\nmod fn increment(value: int) -> int;\n",
|
||||
"src/helpers.pbs": "fn increment(value: int) -> int { return value+1; }\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { let value=increment(2); if value!=3 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "bcf9162dd44b7b7a50428e368789d10ab929301f382bae7c35cab06f1595c4b1"
|
||||
},
|
||||
{
|
||||
"id": "F3-global",
|
||||
"family": "same-module-files",
|
||||
"description": "mod global mutated from another file",
|
||||
"control": "F3-global-local",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\nmod global count;\n",
|
||||
"src/state.pbs": "declare global count: int=0;\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { count=4; if count!=4 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "89c0749385172457659ca2e337ebc368e349065626a815198c314a089d95fc34"
|
||||
},
|
||||
{
|
||||
"id": "F3-service",
|
||||
"family": "same-module-files",
|
||||
"description": "mod service called from another file",
|
||||
"control": "F3-service-local",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\nmod service Helper;\n",
|
||||
"src/helpers.pbs": "declare service Helper { fn value() -> int { return 3; } }\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { let value=Helper.value(); if value!=3 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "37b6c3b4c7d94d1f6f1cc258c84791fdd32c20ea38a88940b735fccf1c7f3b22"
|
||||
},
|
||||
{
|
||||
"id": "F3-global-local",
|
||||
"family": "same-module-files",
|
||||
"description": "Control: identical global and caller in the same file",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare global count: int=0;\n[Frame] fn frame() -> void { count=4; if count!=4 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "e175339cc069d0e14deb8e4e098b1310d877851f2415991ad65b446563aea924"
|
||||
},
|
||||
{
|
||||
"id": "F3-service-local",
|
||||
"family": "same-module-files",
|
||||
"description": "Control: identical service and caller in the same file",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare service Helper { fn value() -> int { return 3; } }\n[Frame] fn frame() -> void { let value=Helper.value(); if value!=3 { let failure=1/0; } }\n"
|
||||
},
|
||||
"sourceSha256": "387e15a0de25644a8862b6f88b74fc7839795e10c8736ebc5ada31670ffd79cb"
|
||||
},
|
||||
{
|
||||
"id": "F3-file-private",
|
||||
"family": "same-module-files",
|
||||
"description": "Negative control: function absent from barrel stays file-private",
|
||||
"control": "F3-function",
|
||||
"expectedCompile": "rejected",
|
||||
"expectedRuntime": "not_run",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/helpers.pbs": "fn increment(value: int) -> int { return value+1; }\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { let value=increment(2); }\n"
|
||||
},
|
||||
"sourceSha256": "b9359695e141c6fd14d5fbfcab68a8829ef4d87c3c7408dbc366465184ec2cfb"
|
||||
},
|
||||
{
|
||||
"id": "F4-distinct",
|
||||
"family": "homonymous-types",
|
||||
"description": "Types ARoomData/BRoomData; dependency=True; direct=False",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { A } from @caseapp:a;\nimport { B } from @caseapp:b;\n[Frame] fn frame() -> void { let value=A.value(); if value!=3 { let failure=1/0; } let other=B.value(); if other!=2 { let failure=1/0; } }\n",
|
||||
"src/a/mod.barrel": "pub service A;\nmod struct ARoomData;\n",
|
||||
"src/a/data.pbs": "declare struct ARoomData() { fn value() -> int { return 1; } }\n",
|
||||
"src/a/main.pbs": "import { B } from @caseapp:b;\ndeclare global room: ARoomData = new ARoomData();\ndeclare service A { fn value() -> int { let own=room.value(); let other=B.value(); return own+other; } }\n",
|
||||
"src/b/mod.barrel": "pub service B;\nmod struct BRoomData;\n",
|
||||
"src/b/data.pbs": "declare struct BRoomData() { fn value() -> int { return 2; } }\n",
|
||||
"src/b/main.pbs": "declare global room: BRoomData = new BRoomData();\ndeclare service B { fn value() -> int { return room.value(); } }\n"
|
||||
},
|
||||
"sourceSha256": "99c527e7749e4ea7c1cecce4063467e4f411b5481cdd641186975fee42299811"
|
||||
},
|
||||
{
|
||||
"id": "F4-same-no-dependency",
|
||||
"family": "homonymous-types",
|
||||
"description": "Types RoomData/RoomData; dependency=False; direct=False",
|
||||
"control": "F4-distinct",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { A } from @caseapp:a;\nimport { B } from @caseapp:b;\n[Frame] fn frame() -> void { let value=A.value(); if value!=1 { let failure=1/0; } let other=B.value(); if other!=2 { let failure=1/0; } }\n",
|
||||
"src/a/mod.barrel": "pub service A;\nmod struct RoomData;\n",
|
||||
"src/a/data.pbs": "declare struct RoomData() { fn value() -> int { return 1; } }\n",
|
||||
"src/a/main.pbs": "declare global room: RoomData = new RoomData();\ndeclare service A { fn value() -> int { let own=room.value(); return own; } }\n",
|
||||
"src/b/mod.barrel": "pub service B;\nmod struct RoomData;\n",
|
||||
"src/b/data.pbs": "declare struct RoomData() { fn value() -> int { return 2; } }\n",
|
||||
"src/b/main.pbs": "declare global room: RoomData = new RoomData();\ndeclare service B { fn value() -> int { return room.value(); } }\n"
|
||||
},
|
||||
"sourceSha256": "db3c59d1f4f618856ed554310e5774f60d64f70e9ed0b122a5ab57d4e9870ce5"
|
||||
},
|
||||
{
|
||||
"id": "F4-same-dependency",
|
||||
"family": "homonymous-types",
|
||||
"description": "Types RoomData/RoomData; dependency=True; direct=False",
|
||||
"control": "F4-distinct",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { A } from @caseapp:a;\nimport { B } from @caseapp:b;\n[Frame] fn frame() -> void { let value=A.value(); if value!=3 { let failure=1/0; } let other=B.value(); if other!=2 { let failure=1/0; } }\n",
|
||||
"src/a/mod.barrel": "pub service A;\nmod struct RoomData;\n",
|
||||
"src/a/data.pbs": "declare struct RoomData() { fn value() -> int { return 1; } }\n",
|
||||
"src/a/main.pbs": "import { B } from @caseapp:b;\ndeclare global room: RoomData = new RoomData();\ndeclare service A { fn value() -> int { let own=room.value(); let other=B.value(); return own+other; } }\n",
|
||||
"src/b/mod.barrel": "pub service B;\nmod struct RoomData;\n",
|
||||
"src/b/data.pbs": "declare struct RoomData() { fn value() -> int { return 2; } }\n",
|
||||
"src/b/main.pbs": "declare global room: RoomData = new RoomData();\ndeclare service B { fn value() -> int { return room.value(); } }\n"
|
||||
},
|
||||
"sourceSha256": "c4c624cb3556b8d05927ceda69e596482f4ec1d7b82f7f4ca7442483e2b8b831"
|
||||
},
|
||||
{
|
||||
"id": "F4-rename-a",
|
||||
"family": "homonymous-types",
|
||||
"description": "Types StartRoomData/RoomData; dependency=True; direct=False",
|
||||
"control": "F4-distinct",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { A } from @caseapp:a;\nimport { B } from @caseapp:b;\n[Frame] fn frame() -> void { let value=A.value(); if value!=3 { let failure=1/0; } let other=B.value(); if other!=2 { let failure=1/0; } }\n",
|
||||
"src/a/mod.barrel": "pub service A;\nmod struct StartRoomData;\n",
|
||||
"src/a/data.pbs": "declare struct StartRoomData() { fn value() -> int { return 1; } }\n",
|
||||
"src/a/main.pbs": "import { B } from @caseapp:b;\ndeclare global room: StartRoomData = new StartRoomData();\ndeclare service A { fn value() -> int { let own=room.value(); let other=B.value(); return own+other; } }\n",
|
||||
"src/b/mod.barrel": "pub service B;\nmod struct RoomData;\n",
|
||||
"src/b/data.pbs": "declare struct RoomData() { fn value() -> int { return 2; } }\n",
|
||||
"src/b/main.pbs": "declare global room: RoomData = new RoomData();\ndeclare service B { fn value() -> int { return room.value(); } }\n"
|
||||
},
|
||||
"sourceSha256": "6cab04b1fbc3724cec1670a11ab46a792e5b83ea1fb12b4bf80f98d178c1290e"
|
||||
},
|
||||
{
|
||||
"id": "F4-same-direct",
|
||||
"family": "homonymous-types",
|
||||
"description": "Types RoomData/RoomData; dependency=True; direct=True",
|
||||
"control": "F4-distinct",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { A } from @caseapp:a;\nimport { B } from @caseapp:b;\n[Frame] fn frame() -> void { let value=A.value(); if value!=3 { let failure=1/0; } let other=B.value(); if other!=2 { let failure=1/0; } }\n",
|
||||
"src/a/mod.barrel": "pub service A;\nmod struct RoomData;\n",
|
||||
"src/a/data.pbs": "declare struct RoomData() { fn value() -> int { return 1; } }\n",
|
||||
"src/a/main.pbs": "import { B } from @caseapp:b;\ndeclare global room: RoomData = new RoomData();\ndeclare service A { fn value() -> int { return room.value()+B.value(); } }\n",
|
||||
"src/b/mod.barrel": "pub service B;\nmod struct RoomData;\n",
|
||||
"src/b/data.pbs": "declare struct RoomData() { fn value() -> int { return 2; } }\n",
|
||||
"src/b/main.pbs": "declare global room: RoomData = new RoomData();\ndeclare service B { fn value() -> int { return room.value(); } }\n"
|
||||
},
|
||||
"sourceSha256": "79fc0901e3e60e7b50b83f5d10ba4e548bd57b0c83d281def25369cadb74633e"
|
||||
},
|
||||
{
|
||||
"id": "F4-public-aliases",
|
||||
"family": "homonymous-types",
|
||||
"description": "Two distinct nominal RoomData declarations imported with aliases",
|
||||
"control": "F4-distinct",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { RoomData as LeftData } from @caseapp:a;\nimport { RoomData as RightData } from @caseapp:b;\ndeclare global left: LeftData = new LeftData(1);\ndeclare global right: RightData = new RightData(2);\n[Frame] fn frame() -> void { let a=left.value(); let b=right.value(); if a!=1 || b!=2 { let failure=1/0; } }\n",
|
||||
"src/a/mod.barrel": "pub struct RoomData;\n",
|
||||
"src/a/main.pbs": "declare struct RoomData(number: int) { fn value() -> int { return this.number; } }\n",
|
||||
"src/b/mod.barrel": "pub struct RoomData;\n",
|
||||
"src/b/main.pbs": "declare struct RoomData(number: int) { fn value() -> int { return this.number; } }\n"
|
||||
},
|
||||
"sourceSha256": "9379bc7c71cd6c1ff287f5771a78590a2e25b8dead05e78c563ff25ee8d1c207"
|
||||
},
|
||||
{
|
||||
"id": "F5-shopvisit",
|
||||
"family": "imported-struct-construction",
|
||||
"description": "Imported ShopVisit, alias=None, positional=False",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { ShopVisit } from @caseapp:scene;\nimport { Link } from @caseapp:link;\ndeclare global scene: ShopVisit = new ShopVisit.make(10);\n[Frame] fn frame() -> void { let value=Link.read(scene); if value!=10 { let failure=1/0; } }\n",
|
||||
"src/scene/mod.barrel": "pub struct ShopVisit;\n",
|
||||
"src/scene/main.pbs": "declare struct ShopVisit(value: int) { ctor make(value: int) { this.value=value; } fn read() -> int { return this.value; } }\n",
|
||||
"src/link/mod.barrel": "pub service Link;\n",
|
||||
"src/link/main.pbs": "import { ShopVisit } from @caseapp:scene;\ndeclare service Link { fn read(scene: ShopVisit) -> int { return scene.read(); } }\n"
|
||||
},
|
||||
"sourceSha256": "5373eaa6bece79658cb4cbd74fecc47d7d2a5954eee1812576243155fecb4c38"
|
||||
},
|
||||
{
|
||||
"id": "F5-scene",
|
||||
"family": "imported-struct-construction",
|
||||
"description": "Imported Scene, alias=None, positional=False",
|
||||
"control": "F5-shopvisit",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { Scene } from @caseapp:scene;\nimport { Link } from @caseapp:link;\ndeclare global scene: Scene = new Scene.make(10);\n[Frame] fn frame() -> void { let value=Link.read(scene); if value!=10 { let failure=1/0; } }\n",
|
||||
"src/scene/mod.barrel": "pub struct Scene;\n",
|
||||
"src/scene/main.pbs": "declare struct Scene(value: int) { ctor make(value: int) { this.value=value; } fn read() -> int { return this.value; } }\n",
|
||||
"src/link/mod.barrel": "pub service Link;\n",
|
||||
"src/link/main.pbs": "import { Scene } from @caseapp:scene;\ndeclare service Link { fn read(scene: Scene) -> int { return scene.read(); } }\n"
|
||||
},
|
||||
"sourceSha256": "f84b4a4f6eb21100dfff74f26e4f453d4300d3e2dd79d70ee9b3992ed4c8d09f"
|
||||
},
|
||||
{
|
||||
"id": "F5-scene-alias",
|
||||
"family": "imported-struct-construction",
|
||||
"description": "Imported Scene, alias=WorldScene, positional=False",
|
||||
"control": "F5-shopvisit",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { Scene as WorldScene } from @caseapp:scene;\nimport { Link } from @caseapp:link;\ndeclare global scene: WorldScene = new WorldScene.make(10);\n[Frame] fn frame() -> void { let value=Link.read(scene); if value!=10 { let failure=1/0; } }\n",
|
||||
"src/scene/mod.barrel": "pub struct Scene;\n",
|
||||
"src/scene/main.pbs": "declare struct Scene(value: int) { ctor make(value: int) { this.value=value; } fn read() -> int { return this.value; } }\n",
|
||||
"src/link/mod.barrel": "pub service Link;\n",
|
||||
"src/link/main.pbs": "import { Scene } from @caseapp:scene;\ndeclare service Link { fn read(scene: Scene) -> int { return scene.read(); } }\n"
|
||||
},
|
||||
"sourceSha256": "0f53a73f0f969919df0ad0df8a93e5b8e8db552310b69d37cae0f3ff9d625959"
|
||||
},
|
||||
{
|
||||
"id": "F5-scene-positional",
|
||||
"family": "imported-struct-construction",
|
||||
"description": "Imported Scene, alias=None, positional=True",
|
||||
"control": "F5-shopvisit",
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "import { Scene } from @caseapp:scene;\nimport { Link } from @caseapp:link;\ndeclare global scene: Scene = new Scene(10);\n[Frame] fn frame() -> void { let value=Link.read(scene); if value!=10 { let failure=1/0; } }\n",
|
||||
"src/scene/mod.barrel": "pub struct Scene;\n",
|
||||
"src/scene/main.pbs": "declare struct Scene(value: int) { ctor make(value: int) { this.value=value; } fn read() -> int { return this.value; } }\n",
|
||||
"src/link/mod.barrel": "pub service Link;\n",
|
||||
"src/link/main.pbs": "import { Scene } from @caseapp:scene;\ndeclare service Link { fn read(scene: Scene) -> int { return scene.read(); } }\n"
|
||||
},
|
||||
"sourceSha256": "65b3452b0e30037b1e744de8e36dc629f2f5d11f5fb97068566d1a4b38baaeb7"
|
||||
},
|
||||
{
|
||||
"id": "runtime-trap-control",
|
||||
"family": "harness-control",
|
||||
"description": "Deliberate guest fault proves frame assertions are executed",
|
||||
"control": null,
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "fault",
|
||||
"files": {
|
||||
"prometeu.json": "{\n \"name\": \"caseapp\",\n \"version\": \"1.0.0\",\n \"language\": \"pbs\",\n \"stdlib\": \"1\",\n \"target\": \"Game\",\n \"dependencies\": []\n}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { let failure=1/0; }\n"
|
||||
},
|
||||
"sourceSha256": "60013483001b50eb3e7f8a9360142ec5ab49f8ca56edf1d6b0ca5b32251510d9"
|
||||
}
|
||||
]
|
||||
}
|
||||
+87
@@ -0,0 +1,87 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"cases": [
|
||||
{
|
||||
"id": "contextual-overloads",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare struct Probe() { fn value() -> int { return 1; } fn value() -> bool { return true; } }\ndeclare global data: Probe = new Probe();\nfn check() -> bool { return data.value(); }\n[Frame] fn frame() -> void { let number: int=data.value(); let flag: bool=data.value(); if !check() || !flag || number!=1 { let failure=1/0; } }\n"
|
||||
},
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"sourceSha256": "c86450c4288ddbe77a90160b93a4d1df6c394fafdbd6de2541f9e3a296eafc07"
|
||||
},
|
||||
{
|
||||
"id": "receiver-argument-order",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/main.pbs": "declare global calls: int=0;\ndeclare struct Probe() { fn read(value: int) -> int { return value; } }\ndeclare global data: Probe=new Probe();\nfn receiver() -> Probe { calls=calls*10+1; return data; }\nfn arg() -> int { calls=calls*10+2; return 3; }\n[Frame] fn frame() -> void { calls=0; let value=receiver().read(arg()); if value!=3 || calls!=12 { let failure=1/0; } }\n"
|
||||
},
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"sourceSha256": "c37878a556424c11771db991be61c589a8243667c5b0c957216f23990ef88ca6"
|
||||
},
|
||||
{
|
||||
"id": "shared-global-storage",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\nmod global count;\nmod fn increment() -> int;\n",
|
||||
"src/state.pbs": "declare global count: int=0;\nfn increment() -> int { count+=1; return count; }\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { count=4; let value=increment(); if value!=5 || count!=5 { let failure=1/0; } }\n"
|
||||
},
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"sourceSha256": "95b641e1371de5bae0339f29bd32d44c81e5861b18ab0d1054e738c958b3ce9f"
|
||||
},
|
||||
{
|
||||
"id": "shared-service-singleton",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\nmod service Counter;\nmod fn instance() -> Counter;\n",
|
||||
"src/state.pbs": "declare service Counter {}\nfn instance() -> Counter { return Counter; }\n",
|
||||
"src/main.pbs": "import { referenceEquals } from @sdk:hash;\n[Frame] fn frame() -> void { if !referenceEquals<Counter>(Counter,instance()) { let failure=1/0; } }\n"
|
||||
},
|
||||
"expectedCompile": "compiled",
|
||||
"expectedRuntime": "passed",
|
||||
"sourceSha256": "e5a21998b2eb8f7e47a5818f59081d080dd332cc36bbb032ddcff07b3335f3d5"
|
||||
},
|
||||
{
|
||||
"id": "private-overload",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\nmod fn helper(value: int) -> int;\n",
|
||||
"src/helper.pbs": "fn helper(value: int) -> int { return value; }\nfn helper(value: bool) -> bool { return value; }\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { let flag=helper(true); }\n"
|
||||
},
|
||||
"expectedCompile": "rejected",
|
||||
"expectedRuntime": "not_run",
|
||||
"sourceSha256": "59d9ab7560f89be231bd82243bcb9114a23c3de2e40b0f02c78669ed56dc917d"
|
||||
},
|
||||
{
|
||||
"id": "private-global",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/state.pbs": "declare global count: int=0;\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { count=4; }\n"
|
||||
},
|
||||
"expectedCompile": "rejected",
|
||||
"expectedRuntime": "not_run",
|
||||
"sourceSha256": "d001a6d5c611d76d3fbf7dd08dcd3391dfe4e69c40b3aa18c69c2fec4c1f8114"
|
||||
},
|
||||
{
|
||||
"id": "private-service",
|
||||
"files": {
|
||||
"prometeu.json": "{\"name\": \"caseapp\", \"version\": \"1.0.0\", \"language\": \"pbs\", \"stdlib\": \"1\", \"target\": \"Game\", \"dependencies\": []}\n",
|
||||
"src/mod.barrel": "pub fn frame() -> void;\n",
|
||||
"src/state.pbs": "declare service Counter { fn value() -> int { return 1; } }\n",
|
||||
"src/main.pbs": "[Frame] fn frame() -> void { let value=Counter.value(); }\n"
|
||||
},
|
||||
"expectedCompile": "rejected",
|
||||
"expectedRuntime": "not_run",
|
||||
"sourceSha256": "1c5386df70cde3889fd16f20fafb7ace636aa32c457a9bea0bef0b35cfc99a07"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user