ready_set_boole/src/negation_normal_form/tests.rs

30 lines
847 B
Rust

#[cfg(test)]
mod tests {
use crate::negation_normal_form::negation_normal_form;
#[test]
fn double_neg_simple() {
assert_eq!(negation_normal_form("A!!"), "A");
assert_eq!(negation_normal_form("B!!!!"), "B");
assert_eq!(negation_normal_form("C!!!"), "C!");
assert_eq!(negation_normal_form("D!!!!!!!!!!!!!!!!"), "D");
assert_eq!(negation_normal_form("E!!!!!!!!!!!!!!!"), "E!");
}
#[test]
fn double_neg() {
assert_eq!(negation_normal_form("A!!B&"), "AB&");
assert_eq!(negation_normal_form("A!!B!!&"), "AB&");
assert_eq!(negation_normal_form("A!!B!&"), "AB!&");
}
#[test]
fn neg_and() {
assert_eq!(negation_normal_form("AB&!"), "A!B!|");
}
#[test]
fn neg_or() {
assert_eq!(negation_normal_form("AB|!"), "A!B!&");
}
}