Fix App::version/long_version test

This commit is contained in:
Logan SQUIREL 2021-02-27 16:31:32 +01:00
parent 3c049b4e22
commit 52e74fa305
No known key found for this signature in database
GPG key ID: E8BDBE1DA96E9B2B

View file

@ -12,6 +12,7 @@ fn version_short() {
.author("Kevin K.")
.about("tests stuff")
.version("1.3")
.long_version("1.3 (abcdef12)")
.try_get_matches_from(vec!["myprog", "-V"]);
assert!(m.is_err());
@ -26,12 +27,13 @@ fn version_long() {
.author("Kevin K.")
.about("tests stuff")
.version("1.3")
.long_version("1.3 (abcdef12)")
.try_get_matches_from(vec!["myprog", "--version"]);
assert!(m.is_err());
let err = m.unwrap_err();
assert_eq!(err.kind, ErrorKind::DisplayVersion);
assert_eq!(err.to_string(), "test 1.3\n");
assert_eq!(err.to_string(), "test 1.3 (abcdef12)\n");
}
#[test]