Prove PresentationMount with authored generic graph operations
This commit is contained in:
@@ -319,3 +319,29 @@ test("chains do not duplicate an application and explicit targets conflict", ()
|
||||
assert.match(JSON.stringify(conflict.diagnostics), /explicit-c/);
|
||||
assert.match(JSON.stringify(conflict.diagnostics), /rule bc/);
|
||||
});
|
||||
|
||||
test("rule inverse reads retain the concrete conformance ownership checks", () => {
|
||||
const compile = fixture([
|
||||
'interface Parent id "parent" revision "parent@1" {}',
|
||||
'interface Child id "child" revision "child@1" {}',
|
||||
'import interface Parent; interface Owned id "owned" revision "owned@1" {queryable relation parent id "parent-ref" : optional-one interface Parent {resolve id "parent-read" execution snapshot targets [browser,server];}}',
|
||||
]);
|
||||
const source = `
|
||||
atom P id "p"; atom C id "c";
|
||||
conform P as Parent id "parent-impl" {
|
||||
private edge Membership id "membership" {
|
||||
atom P projection children id "children" many-unique;
|
||||
interface Child projection parent id "parent" optional-one public-traversal;
|
||||
}
|
||||
}
|
||||
conform C as Child id "child-impl" {}
|
||||
conform Child as Owned id "owned-rule" {bind parent.resolve to edge Membership.parent.resolve;}
|
||||
`;
|
||||
ok(compile(source));
|
||||
const hidden = compile(source.replace(" public-traversal", ""));
|
||||
assert.equal(hidden.ok, false);
|
||||
assert.match(JSON.stringify(hidden.diagnostics), /private|public|own/i);
|
||||
const missing = compile(source.replace("Membership.parent.resolve", "Missing.parent.resolve"));
|
||||
assert.equal(missing.ok, false);
|
||||
assert.match(JSON.stringify(missing.diagnostics), /Unknown attachment/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user