File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,22 @@ fn alias_and_path_for_library() {
146
146
) ;
147
147
}
148
148
149
+ #[ test]
150
+ fn test_beta_rev_parsing ( ) {
151
+ use crate :: extract_beta_rev;
152
+
153
+ // single digit revision
154
+ assert_eq ! ( extract_beta_rev( "1.99.9-beta.7 (xxxxxx)" ) , Some ( "7" . to_string( ) ) ) ;
155
+ // multiple digits
156
+ assert_eq ! ( extract_beta_rev( "1.99.9-beta.777 (xxxxxx)" ) , Some ( "777" . to_string( ) ) ) ;
157
+ // nightly channel (no beta revision)
158
+ assert_eq ! ( extract_beta_rev( "1.99.9-nightly (xxxxxx)" ) , None ) ;
159
+ // stable channel (no beta revision)
160
+ assert_eq ! ( extract_beta_rev( "1.99.9 (xxxxxxx)" ) , None ) ;
161
+ // invalid string
162
+ assert_eq ! ( extract_beta_rev( "invalid" ) , None ) ;
163
+ }
164
+
149
165
mod defaults {
150
166
use super :: { configure, first, run_build} ;
151
167
use crate :: builder:: * ;
You can’t perform that action at this time.
0 commit comments