1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 03:26:18 +00:00

cksum: implement and test --base64 output method

This commit is contained in:
Ben Wiederhake 2024-03-02 04:10:32 +01:00
parent 7b219aee63
commit 133cdde885
15 changed files with 100 additions and 15 deletions

View file

@ -363,6 +363,43 @@ fn test_raw_multiple_files() {
.code_is(1);
}
#[test]
fn test_base64_raw_conflicts() {
new_ucmd!()
.arg("--base64")
.arg("--raw")
.arg("lorem_ipsum.txt")
.fails()
.no_stdout()
.stderr_contains("--base64")
.stderr_contains("cannot be used with")
.stderr_contains("--raw");
}
#[test]
fn test_base64_single_file() {
for algo in ALGOS {
new_ucmd!()
.arg("--base64")
.arg("lorem_ipsum.txt")
.arg(format!("--algorithm={algo}"))
.succeeds()
.no_stderr()
.stdout_is_fixture_bytes(format!("base64/{algo}_single_file.expected"));
}
}
#[test]
fn test_base64_multiple_files() {
new_ucmd!()
.arg("--base64")
.arg("--algorithm=md5")
.arg("lorem_ipsum.txt")
.arg("alice_in_wonderland.txt")
.succeeds()
.no_stderr()
.stdout_is_fixture_bytes(format!("base64/md5_multiple_files.expected"));
}
#[test]
fn test_fail_on_folder() {
let (at, mut ucmd) = at_and_ucmd!();

View file

@ -0,0 +1 @@
BLAKE2b (lorem_ipsum.txt) = DpegkYnlYMN4nAv/HwIBZoYe+FfR+/5FdN4YQuPAbKu5V15K9jCaFmFYwrQI08A4wbSdgos1FYFCzcA5bRGVww==

View file

@ -0,0 +1 @@
08109 1 lorem_ipsum.txt

View file

@ -0,0 +1 @@
378294376 772 lorem_ipsum.txt

View file

@ -0,0 +1,2 @@
MD5 (lorem_ipsum.txt) = zXJGkPfcYXdd+sQApx8sqg==
MD5 (alice_in_wonderland.txt) = 9vpwM+FhZqlYmqHAOI/9WA==

View file

@ -0,0 +1 @@
MD5 (lorem_ipsum.txt) = zXJGkPfcYXdd+sQApx8sqg==

View file

@ -0,0 +1 @@
SHA1 (lorem_ipsum.txt) = qx3QuuHYiDo9GKZt5q+9KCUs++8=

View file

@ -0,0 +1 @@
SHA224 (lorem_ipsum.txt) = PeZvvK0QbhtAqzkb5WxR0gB+sfnGVdD04pv8AQ==

View file

@ -0,0 +1 @@
SHA256 (lorem_ipsum.txt) = 98QgUBxQ4AswklAQDWfqXpEJgVNrRYL+nENb2Ss/HwI=

View file

@ -0,0 +1 @@
SHA384 (lorem_ipsum.txt) = S+S5Cg0NMpZpkpIQGfJKvIJNz7ixxAgQLx9niPuAupqaTFp7V1ozU6kKjucZSB3L

View file

@ -0,0 +1 @@
SHA512 (lorem_ipsum.txt) = llRkqyVWqtWOvHPYmtIh5Vl5dSnsr8D0ZsEXlc/21uLGD5agfFQs/R9Cbl5P4KSKoVZnukQJayE9CBPNA436BQ==

View file

@ -0,0 +1 @@
SM3 (lorem_ipsum.txt) = bSlrgF0GC/7SKAjfMI27m0MXeU3U7WdAoQdwp4Jpm8I=

View file

@ -0,0 +1 @@
6985 2 lorem_ipsum.txt