Skip to content

Commit 8068f9a

Browse files
committed
---
yaml --- r: 4309 b: refs/heads/master c: 2f7ed33 h: refs/heads/master i: 4307: b7f8b2a v: v3
1 parent 2eb945a commit 8068f9a

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 939bca0d84af1b52539d7b02a3be03bd64fcc17d
2+
refs/heads/master: 2f7ed335178c7fbe5d35e015774ca06486c69ce3

trunk/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)