diff options
Diffstat (limited to 'test/unit/kernel/Branch.ml')
| -rw-r--r-- | test/unit/kernel/Branch.ml | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/unit/kernel/Branch.ml b/test/unit/kernel/Branch.ml index a0f201d..10789cd 100644 --- a/test/unit/kernel/Branch.ml +++ b/test/unit/kernel/Branch.ml @@ -256,6 +256,23 @@ let a_denial_program_runs_once_per_judgement () = (K.Scope.publish root ~branch:"master" ~home:library ~denials:["dated", Some dated] []) ); check int "and its program ran once to judge it" 1 !evaluations +let a_denial_binds_an_attribute () = + let root = fresh ["Date"] in + let codd = + K.EphemeralRelation.of_program title + Rnt.Evaluators.FOL.( + program + (Where (Base (K.Scope.path library "book"), BatMap.String.singleton "title" (s "Codd"))) ) + in + publish root ~denials:["no-codd", Some codd] []; + check bool "a book the rule binds is refused" true + (Result.is_error + (K.Scope.publish root ~branch:"master" ~home:library ["book", Some (books ["Date"; "Codd"])]) ); + publish root ["book", Some (books ["Date"; "Darwen"])]; + check (list Helpers.value) "any other book lands" + [s "Darwen"; s "Date"] + (read root (under master (K.Scope.path library "book"))) + let suites () = [ ( "kernel/branch", [ test_case "reads-as-of-each-state" `Quick reads_as_of_each_state; @@ -271,4 +288,5 @@ let suites () = test_case "a-denial-without-end-cannot-be-installed" `Quick a_denial_without_end_cannot_be_installed; test_case "a-denial-program-runs-once-per-judgement" `Quick - a_denial_program_runs_once_per_judgement ] ) ] + a_denial_program_runs_once_per_judgement; + test_case "a-denial-binds-an-attribute" `Quick a_denial_binds_an_attribute ] ) ] |
