Skip to content

Commit

Permalink
More ns keysets tests
Browse files Browse the repository at this point in the history
  • Loading branch information
0xd34df00d committed Nov 30, 2023
1 parent 4421394 commit 5d91897
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions pact-core-tests/pact-tests/keysets.repl
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,43 @@
(define-keyset "alice.alice-keys" (read-keyset 'bob-keys)))

(commit-tx)

(begin-tx)

(env-data
{ "TEST <2>." : ["test"]
, "" : ["test"]
})
(env-keys ["test"])

;; clear env - post fork
(env-exec-config ["RequireKeysetNs"])

(expect-failure
"keyset definition parsing is not permissive post-pact-4.4 - define-keyset"
"namespace"
(define-keyset "TEST <2>."))

(expect-failure
"keyset definition parsing is permissive post-pact-4.4 - enforce-guard - keyset ref"
(enforce-guard (keyset-ref-guard "TEST <2>.")))

(namespace 'alice)
(expect-failure
"keyset name format is not permissive post-pact-4.4 - empty-keyset - define-keyset"
"incorrect keyset name format"
(define-keyset ""))

(expect-failure
"keyset name format is not permissive post-pact-4.4 - empty-keyset - enforce-keyset"
"incorrect keyset name format"
(enforce-keyset ""))

(expect-failure
"keyset name format is not permissive post-pact-4.4 - empty keyset - enforce-guard - keyset ref"
"incorrect keyset name format"
(enforce-guard (keyset-ref-guard "")))

;; admin/user guard differentiation in keyset

(commit-tx)

0 comments on commit 5d91897

Please sign in to comment.