Experimental method for testing all permutations
This commit is contained in:
parent
21d4b1d605
commit
f3b4cdc399
@ -364,6 +364,16 @@ mod tests
|
|||||||
use crate::*;
|
use crate::*;
|
||||||
use crate::format::terms::tests::*;
|
use crate::format::terms::tests::*;
|
||||||
|
|
||||||
|
fn assert_all<F>(input: F, output: &str)
|
||||||
|
where
|
||||||
|
F: Fn(Box<Fn(Box<Formula>) -> Box<Formula>>) -> Box<Formula>,
|
||||||
|
{
|
||||||
|
assert_eq!(format(input(Box::new(|f| f))), output);
|
||||||
|
assert_eq!(format(input(Box::new(|f| and(vec![f])))), output);
|
||||||
|
assert_eq!(format(input(Box::new(|f| or(vec![f])))), output);
|
||||||
|
assert_eq!(format(input(Box::new(|f| if_and_only_if(vec![f])))), output);
|
||||||
|
}
|
||||||
|
|
||||||
fn format(formula: Box<ast::Formula>) -> String
|
fn format(formula: Box<ast::Formula>) -> String
|
||||||
{
|
{
|
||||||
format!("{}", formula)
|
format!("{}", formula)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user