risinglightdb / sqllogictest-rs

Sqllogictest (dialect with extensions) parser and runner in Rust.
Apache License 2.0
172 stars 45 forks source link

Use lines() instead of split('\n') in parse_inner #139

Closed mrob95 closed 1 year ago

mrob95 commented 1 year ago

Should fix https://github.com/apache/arrow-datafusion/issues/4494

Currently when parsing files which use \r\n to separate lines on Windows, the query-result separator line looks like ----\r. This fails the if line == "----" { check, resulting in the whole file being swallowed as part of the query. The built-in lines method fixes this issue by splitting on both \n and \r\n.

The change in the result for the include_glob test is due to lines() trimming a trailing newline from one of the included files.