23 lines
621 B
Rust
23 lines
621 B
Rust
#[cfg(test)]
|
|
mod tests {
|
|
use crate::negation_normal_form::negation_normal_form;
|
|
|
|
#[test]
|
|
fn double_neg() {
|
|
assert_eq!(negation_normal_form("A!!"), "A");
|
|
assert_eq!(negation_normal_form("A!!!!"), "A");
|
|
assert_eq!(negation_normal_form("A!!!"), "A!");
|
|
assert_eq!(negation_normal_form("A!!!!!!!!!!!!!!!!"), "A");
|
|
assert_eq!(negation_normal_form("A!!!!!!!!!!!!!!!"), "A!");
|
|
}
|
|
|
|
#[test]
|
|
fn neg_and() {
|
|
assert_eq!(negation_normal_form("AB&!"), "A!B!|");
|
|
}
|
|
|
|
#[test]
|
|
fn neg_or() {
|
|
assert_eq!(negation_normal_form("AB|!"), "A!B!&");
|
|
}
|
|
} |