File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -29,9 +29,45 @@ struct Path_test
2929    */  
3030    }
3131
32+     void 
33+     testStartsWith ()
34+     {
35+         using  namespace  files ; 
36+ 
37+         //  empty
38+         {
39+             BOOST_TEST (startsWith (" "  , " "  ));
40+         }
41+ 
42+         //  identical
43+         {
44+             BOOST_TEST (startsWith (" /"  , " /"  ));
45+             BOOST_TEST (startsWith (" /abc"  , " /abc"  ));
46+             BOOST_TEST (startsWith (" /abc/def"  , " /abc/def"  ));
47+         }
48+ 
49+         //  equivalent
50+         {
51+             BOOST_TEST (startsWith (" /"  , " \\ "  ));
52+             BOOST_TEST (startsWith (" /abc"  , " \\ abc"  ));
53+             BOOST_TEST (startsWith (" \\ abc"  , " /abc"  ));
54+             BOOST_TEST (startsWith (" /abc/def"  , " \\ abc\\ def"  ));
55+             BOOST_TEST (startsWith (" \\ abc\\ def"  , " /abc/def"  ));
56+         }
57+ 
58+         //  subdirectory
59+         {
60+             BOOST_TEST (startsWith (" /abc/def"  , " /abc"  ));
61+             BOOST_TEST (startsWith (" \\ abc\\ def"  , " /abc"  ));
62+             BOOST_TEST_NOT (startsWith (" /abcdef"  , " /abc"  ));
63+             BOOST_TEST_NOT (startsWith (" \\ abcdef"  , " /abc"  ));
64+         }
65+     }
66+ 
3267    void  run ()
3368    {
3469        testPaths ();
70+         testStartsWith ();
3571    }
3672};
3773
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments