mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
printf: added failing tests on alternative hex form
This commit is contained in:
committed by
Terts Diepraam
parent
0071442cba
commit
3b884966ac
@@ -639,3 +639,29 @@ fn partial_char() {
|
||||
"printf: warning: bc: character(s) following character constant have been ignored\n",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sub_alternative_lower_hex_0() {
|
||||
new_ucmd!().args(&["%#x", "0"]).succeeds().stdout_only("0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sub_alternative_lower_hex() {
|
||||
new_ucmd!()
|
||||
.args(&["%#x", "42"])
|
||||
.succeeds()
|
||||
.stdout_only("0x2a");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sub_alternative_upper_hex_0() {
|
||||
new_ucmd!().args(&["%#X", "0"]).succeeds().stdout_only("0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn sub_alternative_upper_hex() {
|
||||
new_ucmd!()
|
||||
.args(&["%#X", "42"])
|
||||
.succeeds()
|
||||
.stdout_only("0x2A");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user