Omega359 commented on code in PR #13902:
URL: https://github.com/apache/datafusion/pull/13902#discussion_r1897568580
##########
datafusion/sqllogictest/bin/sqllogictests.rs:
##########
@@ -40,19 +40,25 @@ pub fn main() -> Result<()> {
.block_on(run_tests())
}
-fn value_validator(actual: &[Vec<String>], expected: &[String]) -> bool {
- let expected = expected
- .iter()
- // Trailing whitespace from lines in SLT will typically be removed,
but do not fail if it is not
- // If particular test wants to cover trailing whitespace on a value,
- // it should project additional non-whitespace column on the right.
- .map(|s| s.trim_end().to_owned())
- .collect::<Vec<_>>();
+#[allow(clippy::ptr_arg)]
+fn normalizer(s: &String) -> String {
+ // Trailing whitespace from lines in SLT will typically be removed, but do
not fail if it is not
+ // If particular test wants to cover trailing whitespace on a value,
+ // it should project additional non-whitespace column on the right.
+ s.trim_end().to_owned()
+}
+
+fn value_validator(
+ normalizer: Normalizer,
Review Comment:
Yes. However, in my sidebranch for the sqlite tests it made things a bit
cleaner, and in the branch I used to generate the 'cleansed' .slt files it was
necessary as normalization was required where validation was not. I have no
desire to spend any more time working on that dependency tbh so if you feel
strongly about it I'll point you at that project :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]