From 43c30a93212a580a6e3c2b247f0d4d8787dd5e6c Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Fri, 22 Apr 2022 09:34:34 -0400 Subject: [PATCH] add invalid_function_test --- src/function_handling/suggestions.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/function_handling/suggestions.rs b/src/function_handling/suggestions.rs index 2344d3a..ead34f5 100644 --- a/src/function_handling/suggestions.rs +++ b/src/function_handling/suggestions.rs @@ -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::>() + }) + .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); + } + }); + } }