From 9500aff0524f2ac1cc2af7cedefe9876a026e3a8 Mon Sep 17 00:00:00 2001 From: marceloll Date: Wed, 6 Jan 2021 10:18:48 -0300 Subject: [PATCH] Use ; as comment in tests segxp section --- cli/src/test.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/src/test.rs b/cli/src/test.rs index c8cfe89f..ffaf6635 100644 --- a/cli/src/test.rs +++ b/cli/src/test.rs @@ -22,6 +22,7 @@ lazy_static! { .multi_line(true) .build() .unwrap(); + static ref COMMENT_REGEX: Regex = Regex::new(r";.*").unwrap(); static ref WHITESPACE_REGEX: Regex = Regex::new(r"\s+").unwrap(); static ref SEXP_FIELD_REGEX: Regex = Regex::new(r" \w+: \(").unwrap(); } @@ -392,8 +393,10 @@ fn parse_test_content(name: String, content: String, file_path: Option) input.pop(); } + // Remove all comments + let output = COMMENT_REGEX.replace_all(output, "").to_string(); // Normalize the whitespace in the expected output. - let output = WHITESPACE_REGEX.replace_all(output.trim(), " ").to_string(); + let output = WHITESPACE_REGEX.replace_all(output.trim(), " "); let output = output.replace(" )", ")"); // Identify if the expected output has fields indicated. If not, then