File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -539,7 +539,7 @@ pub fn generate_dircolors_config() -> String {
539539
540540#[ cfg( test) ]
541541mod tests {
542- use super :: escape ;
542+ use super :: * ;
543543
544544 #[ test]
545545 fn test_escape ( ) {
@@ -548,4 +548,24 @@ mod tests {
548548 assert_eq ! ( "\\ :" , escape( ":" ) ) ;
549549 assert_eq ! ( "\\ :" , escape( "\\ :" ) ) ;
550550 }
551+
552+ #[ test]
553+ fn test_purify ( ) {
554+ let s = " asd#zcv #hk\t \n " ;
555+ assert_eq ! ( "asd#zcv" , s. purify( ) ) ;
556+ }
557+
558+ #[ test]
559+ fn test_fnmatch ( ) {
560+ let s = "con256asd" ;
561+ assert ! ( s. fnmatch( "*[2][3-6][5-9]?sd" ) ) ; // spell-checker:disable-line
562+ }
563+
564+ #[ test]
565+ fn test_split_two ( ) {
566+ let s = "zxc \t \n qwe jlk hjl" ; // spell-checker:disable-line
567+ let ( k, v) = s. split_two ( ) ;
568+ assert_eq ! ( "zxc" , k) ;
569+ assert_eq ! ( "qwe jlk hjl" , v) ;
570+ }
551571}
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:: { OutputFmt , StrUtils , guess_syntax} ;
12+ use dircolors:: { OutputFmt , guess_syntax} ;
1113
1214#[ test]
1315#[ cfg( target_os = "linux" ) ]
@@ -74,20 +76,6 @@ fn test_shell_syntax() {
7476 }
7577}
7678
77- #[ test]
78- fn test_str_utils ( ) {
79- let s = " asd#zcv #hk\t \n " ;
80- assert_eq ! ( "asd#zcv" , s. purify( ) ) ;
81-
82- let s = "con256asd" ;
83- assert ! ( s. fnmatch( "*[2][3-6][5-9]?sd" ) ) ; // spell-checker:disable-line
84-
85- let s = "zxc \t \n qwe jlk hjl" ; // spell-checker:disable-line
86- let ( k, v) = s. split_two ( ) ;
87- assert_eq ! ( "zxc" , k) ;
88- assert_eq ! ( "qwe jlk hjl" , v) ;
89- }
90-
9179#[ test]
9280fn test1 ( ) {
9381 test_helper ( "test1" , "gnome" ) ;
You can’t perform that action at this time.
0 commit comments