mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 19:56:17 +00:00
Merge pull request #3028 from jfinkels/dd-multipliers
dd: add support for 'b' and 'x' multipliers in numeric arguments
This commit is contained in:
commit
1f7c08d87b
2 changed files with 128 additions and 18 deletions
|
@ -1,4 +1,4 @@
|
|||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, availible, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat abcdefghijklm
|
||||
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio, atoe, atoibm, availible, behaviour, bmax, bremain, btotal, cflags, creat, ctable, ctty, datastructures, doesnt, etoa, fileout, fname, gnudd, iconvflags, nocache, noctty, noerror, nofollow, nolinks, nonblock, oconvflags, outfile, parseargs, rlen, rmax, rposition, rremain, rsofar, rstat, sigusr, sigval, wlen, wstat abcdefghijklm abcdefghi
|
||||
|
||||
use crate::common::util::*;
|
||||
|
||||
|
@ -178,6 +178,26 @@ fn test_stdin_stdout_count_w_multiplier() {
|
|||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_b_multiplier() {
|
||||
// "2b" means 2 * 512, which is 1024.
|
||||
new_ucmd!()
|
||||
.args(&["bs=2b", "count=1"])
|
||||
.pipe_in("a".repeat(1025))
|
||||
.succeeds()
|
||||
.stdout_is("a".repeat(1024));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_x_multiplier() {
|
||||
// "2x3" means 2 * 3, which is 6.
|
||||
new_ucmd!()
|
||||
.args(&["bs=2x3", "count=1"])
|
||||
.pipe_in("abcdefghi")
|
||||
.succeeds()
|
||||
.stdout_is("abcdef");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_final_stats_noxfer() {
|
||||
new_ucmd!()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue