File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1264,3 +1264,32 @@ fn test_du_blocksize_zero_do_not_panic() {
12641264 ) ) ;
12651265 }
12661266}
1267+
1268+ #[ test]
1269+ fn test_du_inodes_blocksize_ineffective ( ) {
1270+ let ts = TestScenario :: new ( util_name ! ( ) ) ;
1271+ let at = & ts. fixtures ;
1272+ let fpath = at. plus ( "test.txt" ) ;
1273+ at. touch ( fpath) ;
1274+ for method in [ "-B3" , "--block-size=3" ] {
1275+ // No warning
1276+ ts. ucmd ( )
1277+ . arg ( method)
1278+ . arg ( "--inodes" )
1279+ . arg ( "test.txt" )
1280+ . succeeds ( )
1281+ . stdout_only ( "1\t test.txt\n " ) ;
1282+ }
1283+ for method in [ "--apparent-size" , "-b" ] {
1284+ // A warning appears!
1285+ ts. ucmd ( )
1286+ . arg ( method)
1287+ . arg ( "--inodes" )
1288+ . arg ( "test.txt" )
1289+ . succeeds ( )
1290+ . stdout_is ( "1\t test.txt\n " )
1291+ . stderr_is (
1292+ "du: warning: options --apparent-size and -b are ineffective with --inodes\n " ,
1293+ ) ;
1294+ }
1295+ }
You can’t perform that action at this time.
0 commit comments