File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
clarity-serialization/src Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,27 @@ pub fn version_string(pkg_name: &str, pkg_version: &str) -> String {
51
51
let git_tree_clean = GIT_TREE_CLEAN . unwrap_or ( "" ) ;
52
52
53
53
format ! (
54
- "{pkg_name} {pkg_version} ({git_branch}:{git_commit}{git_tree_clean}, {BUILD_TYPE} build {}, [{}])" ,
54
+ "{pkg_name} {pkg_version} ({git_branch}:{git_commit}{git_tree_clean}, {BUILD_TYPE} build, {} [{}])" ,
55
55
std:: env:: consts:: OS ,
56
56
std:: env:: consts:: ARCH
57
57
)
58
58
}
59
+
60
+ #[ cfg( test) ]
61
+ mod lib_tests {
62
+ use super :: * ;
63
+
64
+ #[ test]
65
+ fn test_version_string_basic_no_env ( ) {
66
+ let version = version_string ( "test-package" , "1.0.0" ) ;
67
+
68
+ assert_eq ! (
69
+ version,
70
+ format!(
71
+ "test-package 1.0.0 (:, {BUILD_TYPE} build, {} [{}])" ,
72
+ std:: env:: consts:: OS ,
73
+ std:: env:: consts:: ARCH
74
+ )
75
+ ) ;
76
+ }
77
+ }
You can’t perform that action at this time.
0 commit comments