File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -534,4 +534,24 @@ mod tests {
534534 assert_eq ! ( Some ( OutputFmt :: Shell ) , guess_syntax( "foo" ) ) ;
535535 assert_eq ! ( None , guess_syntax( "" ) ) ;
536536 }
537+
538+ #[ test]
539+ fn test_purify ( ) {
540+ let s = " asd#zcv #hk\t \n " ;
541+ assert_eq ! ( "asd#zcv" , s. purify( ) ) ;
542+ }
543+
544+ #[ test]
545+ fn test_fnmatch ( ) {
546+ let s = "con256asd" ;
547+ assert ! ( s. fnmatch( "*[2][3-6][5-9]?sd" ) ) ; // spell-checker:disable-line
548+ }
549+
550+ #[ test]
551+ fn test_split_two ( ) {
552+ let s = "zxc \t \n qwe jlk hjl" ; // spell-checker:disable-line
553+ let ( k, v) = s. split_two ( ) ;
554+ assert_eq ! ( "zxc" , k) ;
555+ assert_eq ! ( "qwe jlk hjl" , v) ;
556+ }
537557}
Original file line number Diff line number Diff line change 22//
33// For the full copyright and license information, please view the LICENSE
44// file that was distributed with this source code.
5+
56// spell-checker:ignore overridable colorterm
7+
68#[ cfg( target_os = "linux" ) ]
79use uutests:: at_and_ucmd;
810use uutests:: new_ucmd;
911
10- use dircolors:: StrUtils ;
11-
1212#[ test]
1313#[ cfg( target_os = "linux" ) ]
1414fn test_dircolors_non_utf8_paths ( ) {
@@ -30,20 +30,6 @@ fn test_invalid_arg() {
3030 new_ucmd ! ( ) . arg ( "--definitely-invalid" ) . fails_with_code ( 1 ) ;
3131}
3232
33- #[ test]
34- fn test_str_utils ( ) {
35- let s = " asd#zcv #hk\t \n " ;
36- assert_eq ! ( "asd#zcv" , s. purify( ) ) ;
37-
38- let s = "con256asd" ;
39- assert ! ( s. fnmatch( "*[2][3-6][5-9]?sd" ) ) ; // spell-checker:disable-line
40-
41- let s = "zxc \t \n qwe jlk hjl" ; // spell-checker:disable-line
42- let ( k, v) = s. split_two ( ) ;
43- assert_eq ! ( "zxc" , k) ;
44- assert_eq ! ( "qwe jlk hjl" , v) ;
45- }
46-
4733#[ test]
4834fn test1 ( ) {
4935 test_helper ( "test1" , "gnome" ) ;
You can’t perform that action at this time.
0 commit comments