File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -1264,3 +1264,35 @@ 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+ std:: fs:: File :: create ( & fpath)
1274+ . expect ( "cannot create test file" )
1275+ . set_len ( 123_456 )
1276+ . expect ( "cannot truncate test len to size" ) ;
1277+ for method in [ "-B3" , "--block-size=3" ] {
1278+ // No warning
1279+ ts. ucmd ( )
1280+ . arg ( method)
1281+ . arg ( "--inodes" )
1282+ . arg ( "test.txt" )
1283+ . succeeds ( )
1284+ . stdout_only ( "1\t test.txt\n " ) ;
1285+ }
1286+ for method in [ "--apparent-size" , "-b" ] {
1287+ // A warning appears!
1288+ ts. ucmd ( )
1289+ . arg ( method)
1290+ . arg ( "--inodes" )
1291+ . arg ( "test.txt" )
1292+ . succeeds ( )
1293+ . stdout_is ( "1\t test.txt\n " )
1294+ . stderr_is (
1295+ "du: warning: options --apparent-size and -b are ineffective with --inodes\n " ,
1296+ ) ;
1297+ }
1298+ }
You can’t perform that action at this time.
0 commit comments