File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed
Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,16 @@ impl Capitalize for str {
135135 } )
136136 }
137137}
138+
139+ #[ cfg( test) ]
140+ mod test {
141+ use super :: * ;
142+
143+ #[ test]
144+ fn test_capitalize ( ) {
145+ assert_eq ! ( "Zbnmasd" , "zbnmasd" . capitalize( ) ) ; // spell-checker:disable-line
146+ assert_eq ! ( "Abnmasd" , "Abnmasd" . capitalize( ) ) ; // spell-checker:disable-line
147+ assert_eq ! ( "1masd" , "1masd" . capitalize( ) ) ; // spell-checker:disable-line
148+ assert_eq ! ( "" , "" . capitalize( ) ) ;
149+ }
150+ }
Original file line number Diff line number Diff line change 33// For the full copyright and license information, please view the LICENSE
44// file that was distributed with this source code.
55
6- use pinky:: Capitalize ;
76#[ cfg( not( target_os = "openbsd" ) ) ]
87use uucore:: entries:: { Locate , Passwd } ;
98use uutests:: new_ucmd;
@@ -19,17 +18,11 @@ fn test_invalid_arg() {
1918 new_ucmd ! ( ) . arg ( "--definitely-invalid" ) . fails_with_code ( 1 ) ;
2019}
2120
22- #[ test]
23- fn test_capitalize ( ) {
24- assert_eq ! ( "Zbnmasd" , "zbnmasd" . capitalize( ) ) ; // spell-checker:disable-line
25- assert_eq ! ( "Abnmasd" , "Abnmasd" . capitalize( ) ) ; // spell-checker:disable-line
26- assert_eq ! ( "1masd" , "1masd" . capitalize( ) ) ; // spell-checker:disable-line
27- assert_eq ! ( "" , "" . capitalize( ) ) ;
28- }
29-
3021#[ test]
3122#[ cfg( not( target_os = "openbsd" ) ) ]
3223fn test_long_format ( ) {
24+ use pinky:: Capitalize ;
25+
3326 let login = "root" ;
3427 let pw: Passwd = Passwd :: locate ( login) . unwrap ( ) ;
3528 let user_info = pw. user_info . unwrap_or_default ( ) ;
You can’t perform that action at this time.
0 commit comments