Files
meta-rust/recipes/rust/files/0002-std-io-process-add-Debug-tests.patch
T
Cody P Schafer d50952c452 update rustc to 2015-03-23
We need a git version of libgit2 again :(

Also fix the license complaints
2015-05-26 12:06:27 -04:00

34 lines
1.0 KiB
Diff

From 50cac2149528f7400c7623e5fd31cf579e18a82b Mon Sep 17 00:00:00 2001
From: Cody P Schafer <dev@codyps.com>
Date: Mon, 1 Dec 2014 15:50:13 -0500
Subject: [PATCH 02/13] std/io/process: add Debug tests
---
src/libstd/old_io/process.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/libstd/old_io/process.rs b/src/libstd/old_io/process.rs
index d201f3b..f4dbd68 100644
--- a/src/libstd/old_io/process.rs
+++ b/src/libstd/old_io/process.rs
@@ -1262,4 +1262,16 @@ mod tests {
let val = env.get(&EnvKey(CString::new("PATH").unwrap()));
assert!(val.unwrap() == &CString::new("bar").unwrap());
}
+
+ fn check_debug<D : fmt::Debug>(c: D, v: &str) {
+ assert_eq!(format!("{:?}", c), v)
+ }
+
+ #[test]
+ fn debug() {
+ check_debug(Command::new("gcc ").arg("-Ifoo'bar"), "'gcc ' '-Ifoo'\\''bar'");
+ check_debug(Command::new("c99"), "'c99'");
+ check_debug(Command::new("c99 "), "'c99 '");
+ check_debug(Command::new("Can't buy me love"), "'Can'\\''t buy me love'");
+ }
}
--
2.3.3