From 49cb37b30396bd760e6176e0f1c939bc2af51a58 Mon Sep 17 00:00:00 2001 From: Andreas Steding Date: Wed, 10 Jun 2020 15:45:27 +0200 Subject: [PATCH] Updated tests. --- tests/cargo.rs | 4 ++-- tests/version.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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]