From 46bcc98dc85ab00fa43af9bef42246ff89a28dfe Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy <mmstickman@gmail.com> Date: Mon, 19 Jun 2017 16:54:36 -0400 Subject: [PATCH] Fix Word Parser Test --- src/parser/shell_expand/words.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/parser/shell_expand/words.rs b/src/parser/shell_expand/words.rs index 213cfc13..57bd9167 100644 --- a/src/parser/shell_expand/words.rs +++ b/src/parser/shell_expand/words.rs @@ -983,9 +983,20 @@ impl<'a> Iterator for WordIterator<'a> { mod tests { use super::*; + macro_rules! functions { + () => { + ExpanderFunctions { + tilde: &|_| None, + array: &|_, _| None, + variable: &|_, _| None, + command: &|_, _| None + } + } + } + fn compare(input: &str, expected: Vec<WordToken>) { let mut correct = 0; - for (actual, expected) in WordIterator::new(input, true).zip(expected.iter()) { + for (actual, expected) in WordIterator::new(input, true, &functions!()).zip(expected.iter()) { assert_eq!(actual, *expected, "{:?} != {:?}", actual, expected); correct += 1; } -- GitLab