add invalid_function_test

This commit is contained in:
Simon Gardling 2022-04-22 09:34:34 -04:00
parent 1d0848ebd2
commit 43c30a9321

View File

@ -119,4 +119,26 @@ mod tests {
assert_eq!(value.to_string(), key);
}
}
#[test]
fn invalid_function_test() {
SUPPORTED_FUNCTIONS
.iter()
.map(|func1| {
SUPPORTED_FUNCTIONS
.iter()
.map(|func2| func1.to_string() + func2)
.collect::<Vec<String>>()
})
.flatten()
.filter(|func| !SUPPORTED_FUNCTIONS.contains(&func.as_str()))
.for_each(|key| {
println!("{}", key);
if generate_hint(&key).is_none() {
println!("success: {}", key);
} else {
panic!("failed: {}", key);
}
});
}
}