Skip to content

Commit 4d22908

Browse files
committed
Add basic unit test for translate_unsatisfiable_pk
In preparation for modifying the `translate_unsatisfiable_pk` function add a basic unit test.
1 parent 578dc69 commit 4d22908

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/policy/concrete.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,4 +1205,14 @@ mod tests {
12051205
}));
12061206
assert_eq!(count, 17);
12071207
}
1208+
1209+
#[test]
1210+
fn translate_unsatisfiable_pk() {
1211+
let policy = Policy::<String>::from_str("or(and(pk(A),pk(B)),pk(C))").unwrap();
1212+
1213+
let want = Policy::<String>::from_str("or(and(pk(A),UNSATISFIABLE),pk(C))").unwrap();
1214+
let got = policy.translate_unsatisfiable_pk(&"B".to_string());
1215+
1216+
assert_eq!(got, want);
1217+
}
12081218
}

0 commit comments

Comments
 (0)