Skip to content

Commit 84317cb

Browse files
committed
fix: attempt to fix CI on Windows.
1 parent cb84dc3 commit 84317cb

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

wdl-engine/tests/tasks.rs

+13-10
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::collections::HashSet;
2222
use std::env;
2323
use std::ffi::OsStr;
2424
use std::fs;
25-
use std::path::MAIN_SEPARATOR;
2625
use std::path::Path;
2726
use std::path::PathBuf;
2827
use std::path::absolute;
@@ -88,19 +87,23 @@ fn find_tests() -> Vec<PathBuf> {
8887

8988
/// Normalizes a result.
9089
fn normalize(root: &Path, s: &str) -> String {
90+
// Normalize paths separation characters first
91+
let s = s
92+
.replace("\\", "/")
93+
.replace("//", "/")
94+
.replace("\r\n", "\n");
95+
9196
// Strip any paths that start with the root directory
92-
let s: Cow<'_, str> = if let Some(mut root) = root.to_str().map(str::to_string) {
93-
if !root.ends_with(MAIN_SEPARATOR) {
94-
root.push(MAIN_SEPARATOR);
97+
if let Some(root) = root.to_str().map(str::to_string) {
98+
let mut root = root.replace('\\', "/");
99+
if !root.ends_with('/') {
100+
root.push('/');
95101
}
96102

97-
s.replace(&root, "").into()
103+
s.replace(&root, "")
98104
} else {
99-
s.into()
100-
};
101-
102-
// Normalize paths separation characters
103-
s.replace('\\', "/").replace("\r\n", "\n")
105+
s
106+
}
104107
}
105108

106109
/// Compares a single result.

wdl-engine/tests/tasks/flags-task/source.wdl

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ task flags {
1515

1616
# Instead, make both the flag and the value conditional on `max_matches`
1717
# being defined.
18-
grep ~{"-m " + max_matches} ~{pattern} ~{infile} | wc -l | sed 's/^ *//'
18+
grep ~{"-m " + max_matches} ~{pattern} '~{infile}' | wc -l | sed 's/^ *//'
1919
>>>
2020

2121
output {

wdl-engine/tests/tasks/input-type-qualifiers/source.wdl

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ task input_type_quantifiers {
1616
cat ~{write_lines(a)} >> result
1717
cat ~{write_lines(b)} >> result
1818
~{if defined(c) then
19-
"cat ~{write_lines(select_first([c]))} >> result"
19+
"cat '~{write_lines(select_first([c]))}' >> result"
2020
else ""}
2121
~{if defined(e) then
22-
"cat ~{write_lines(select_first([e]))} >> result"
22+
"cat '~{write_lines(select_first([e]))}' >> result"
2323
else ""}
2424
>>>
2525

wdl-engine/tests/tasks/multiline-strings2/outputs.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"multiline_strings2.hw4": "hello world",
77
"multiline_strings2.hw5": "hello world",
88
"multiline_strings2.hw6": "hello world",
9-
"multiline_strings2.not_equivalent": "hello ///n world"
9+
"multiline_strings2.not_equivalent": "hello //n world"
1010
}

wdl-engine/tests/tasks/private-declaration-task/source.wdl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ task private_declaration {
99
Int num_lines_clamped = if num_lines > 3 then 3 else num_lines
1010

1111
command <<<
12-
head -~{num_lines_clamped} ~{write_lines(lines)}
12+
head -~{num_lines_clamped} '~{write_lines(lines)}'
1313
>>>
1414

1515
output {

0 commit comments

Comments
 (0)