mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
seq: use print_seq_integers() regardless of last
Ensure that the `print_seq_integers()` function is called when the first number and the increment are integers, regardless of the type of the last value specified.
This commit is contained in:
parent
522d4d39e3
commit
bfb1327ad4
2 changed files with 147 additions and 8 deletions
|
@ -199,6 +199,16 @@ fn test_preserve_negative_zero_start() {
|
|||
.succeeds()
|
||||
.stdout_is("-0\n1\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-0", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-0\n1\n2\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-0", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0\n1\n2\n")
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -226,6 +236,50 @@ fn test_width_negative_zero() {
|
|||
.succeeds()
|
||||
.stdout_is("-0\n01\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-0\n01\n02\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0\n01\n02\n")
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_width_negative_zero_decimal_notation() {
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.0", "1"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.0\n01.0\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.0", "1.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.0\n01.0\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.0", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.0\n01.0\n02.0\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.0", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.0\n01.0\n02.0\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.0", "1.0", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.0\n01.0\n02.0\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.0", "1.0", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.0\n01.0\n02.0\n")
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -235,29 +289,63 @@ fn test_width_negative_zero_scientific_notation() {
|
|||
.succeeds()
|
||||
.stdout_is("-0\n01\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0e0", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-0\n01\n02\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0e0", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0\n01\n02\n")
|
||||
.no_stderr();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0e+1", "1"])
|
||||
.succeeds()
|
||||
.stdout_is("-00\n001\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0e+1", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-00\n001\n002\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0e+1", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-00\n001\n002\n")
|
||||
.no_stderr();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e0", "1"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.000\n01.000\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e0", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.000\n01.000\n02.000\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e0", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.000\n01.000\n02.000\n")
|
||||
.no_stderr();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e-2", "1"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.00000\n01.00000\n")
|
||||
.no_stderr();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e5", "1"])
|
||||
.args(&["-w", "-0.000e-2", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n")
|
||||
.stdout_is("-0.00000\n01.00000\n02.00000\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e-2", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-0.00000\n01.00000\n02.00000\n")
|
||||
.no_stderr();
|
||||
|
||||
new_ucmd!()
|
||||
|
@ -265,6 +353,32 @@ fn test_width_negative_zero_scientific_notation() {
|
|||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e5", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n0000002\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e5", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n0000002\n")
|
||||
.no_stderr();
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e5", "1"])
|
||||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e5", "1", "2"])
|
||||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n0000002\n")
|
||||
.no_stderr();
|
||||
new_ucmd!()
|
||||
.args(&["-w", "-0.000e5", "1", "2.0"])
|
||||
.succeeds()
|
||||
.stdout_is("-000000\n0000001\n0000002\n")
|
||||
.no_stderr();
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue