Skip to content

Commit 2fb5fbc

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 0303cce commit 2fb5fbc

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
@@ -1228,4 +1228,14 @@ mod tests {
12281228
}));
12291229
assert_eq!(count, 17);
12301230
}
1231+
1232+
#[test]
1233+
fn translate_unsatisfiable_pk() {
1234+
let policy = Policy::<String>::from_str("or(and(pk(A),pk(B)),pk(C))").unwrap();
1235+
1236+
let want = Policy::<String>::from_str("or(and(pk(A),UNSATISFIABLE),pk(C))").unwrap();
1237+
let got = policy.translate_unsatisfiable_pk(&"B".to_string());
1238+
1239+
assert_eq!(got, want);
1240+
}
12311241
}

0 commit comments

Comments
 (0)