Skip to content

Commit 0f96d8a

Browse files
committed
update test to account for always printing the bit len
1 parent 2d096df commit 0f96d8a

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

tests/by-util/test_cksum.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3150,10 +3150,10 @@ fn test_check_checkfile_with_io_error() {
31503150
"ac"
31513151
)]
31523152
fn test_shake128(#[case] args: &[&str], #[case] expected: &str) {
3153-
let algo_name = if args.is_empty() || args[1] == "0" {
3154-
"SHAKE128".to_string()
3153+
let bit_len = if args.is_empty() || args[1] == "0" {
3154+
"256"
31553155
} else {
3156-
format!("SHAKE128-{}", args[1])
3156+
args[1]
31573157
};
31583158

31593159
new_ucmd!()
@@ -3162,7 +3162,7 @@ fn test_shake128(#[case] args: &[&str], #[case] expected: &str) {
31623162
.args(args)
31633163
.pipe_in("xxx")
31643164
.succeeds()
3165-
.stdout_only(format!("{algo_name} (-) = {expected}\n"));
3165+
.stdout_only(format!("SHAKE128-{bit_len} (-) = {expected}\n"));
31663166
}
31673167

31683168
#[rstest]
@@ -3219,10 +3219,10 @@ fn test_shake128(#[case] args: &[&str], #[case] expected: &str) {
32193219
"2f"
32203220
)]
32213221
fn test_shake256(#[case] args: &[&str], #[case] expected: &str) {
3222-
let algo_name = if args.is_empty() || args[1] == "0" {
3223-
"SHAKE256".to_string()
3222+
let bit_len = if args.is_empty() || args[1] == "0" {
3223+
"512"
32243224
} else {
3225-
format!("SHAKE256-{}", args[1])
3225+
args[1]
32263226
};
32273227

32283228
new_ucmd!()
@@ -3231,5 +3231,5 @@ fn test_shake256(#[case] args: &[&str], #[case] expected: &str) {
32313231
.args(args)
32323232
.pipe_in("xxx")
32333233
.succeeds()
3234-
.stdout_only(format!("{algo_name} (-) = {expected}\n"));
3234+
.stdout_only(format!("SHAKE256-{bit_len} (-) = {expected}\n"));
32353235
}

0 commit comments

Comments
 (0)