diff options
author | David Tolnay <dtolnay@gmail.com> | 2020-09-01 13:02:08 -0700 |
---|---|---|
committer | David Tolnay <dtolnay@gmail.com> | 2020-09-01 13:02:08 -0700 |
commit | 8eb3dcef466c74d8dfb42e74d8f8f8b624f1bb0b (patch) | |
tree | e77b68a14d93a433c5c4fee03a468583e2c0cd80 /gen/cmd/src | |
parent | 9f1e3d76a366acf2ead31a43256766bfcef5352f (diff) | |
download | cxx-8eb3dcef466c74d8dfb42e74d8f8f8b624f1bb0b.tar.gz |
Remove version number from cmd help test
Diffstat (limited to 'gen/cmd/src')
-rw-r--r-- | gen/cmd/src/test.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gen/cmd/src/test.rs b/gen/cmd/src/test.rs index cecb2926..f119189e 100644 --- a/gen/cmd/src/test.rs +++ b/gen/cmd/src/test.rs @@ -1,5 +1,5 @@ const EXPECTED: &str = "\ -cxxbridge 0.3.7 +cxxbridge $VERSION David Tolnay <dtolnay@gmail.com> https://github.com/dtolnay/cxx @@ -41,5 +41,7 @@ fn test_help() { let mut out = Vec::new(); app.write_long_help(&mut out).unwrap(); let help = String::from_utf8(out).unwrap(); - assert_eq!(help, EXPECTED); + let version = option_env!("CARGO_PKG_VERSION").unwrap_or_default(); + let expected = EXPECTED.replace("$VERSION", version); + assert_eq!(help, expected); } |