diff --git a/tests/cargo.rs b/tests/cargo.rs index 5d257209..3ea46d95 100644 --- a/tests/cargo.rs +++ b/tests/cargo.rs @@ -33,7 +33,7 @@ fn crate_version() { assert_eq!(err.kind, ErrorKind::VersionDisplayed); assert_eq!( err.to_string(), - format!("prog {}", env!("CARGO_PKG_VERSION")) + format!("prog {}\n", env!("CARGO_PKG_VERSION")) ); } @@ -70,5 +70,5 @@ fn crate_name() { assert!(res.is_err()); let err = res.unwrap_err(); assert_eq!(err.kind, ErrorKind::VersionDisplayed); - assert_eq!(err.to_string(), "clap "); + assert_eq!(err.to_string(), "clap \n"); } diff --git a/tests/version.rs b/tests/version.rs index dd00ee85..814d4e2f 100644 --- a/tests/version.rs +++ b/tests/version.rs @@ -4,7 +4,7 @@ use std::str; use clap::{App, AppSettings, ErrorKind}; -static VERSION: &str = "clap-test v1.4.8"; +static VERSION: &str = "clap-test v1.4.8\n"; #[test] fn version_short() { @@ -17,7 +17,7 @@ fn version_short() { assert!(m.is_err()); let err = m.unwrap_err(); assert_eq!(err.kind, ErrorKind::VersionDisplayed); - assert_eq!(err.to_string(), "test 1.3"); + assert_eq!(err.to_string(), "test 1.3\n"); } #[test] @@ -31,7 +31,7 @@ fn version_long() { assert!(m.is_err()); let err = m.unwrap_err(); assert_eq!(err.kind, ErrorKind::VersionDisplayed); - assert_eq!(err.to_string(), "test 1.3"); + assert_eq!(err.to_string(), "test 1.3\n"); } #[test]