Skip to content

Commit 2f7ed33

Browse files
committed
Ignore whitespace in argument lists in compiletest
Makes testing work with DEBUG=1
1 parent 939bca0 commit 2f7ed33

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/test/compiletest/compiletest.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,27 @@ mod runtest {
533533
}
534534

535535
fn split_maybe_args(argstr: &option::t[str]) -> vec[str] {
536+
fn rm_whitespace(v: vec[str]) -> vec[str] {
537+
fn flt(s: &str) -> option::t[str] {
538+
if !is_whitespace(s) {
539+
option::some(s)
540+
} else {
541+
option::none
542+
}
543+
}
544+
545+
// FIXME: This should be in std
546+
fn is_whitespace(s: str) -> bool {
547+
for c: u8 in s {
548+
if c != (' ' as u8) { ret false; }
549+
}
550+
ret true;
551+
}
552+
vec::filter_map(flt, v)
553+
}
554+
536555
alt argstr {
537-
option::some(s) { str::split(s, ' ' as u8) }
556+
option::some(s) { rm_whitespace(str::split(s, ' ' as u8)) }
538557
option::none. { [] }
539558
}
540559
}

0 commit comments

Comments
 (0)