-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from rustcoreutils/hacking
cksum: fix output bug and add test
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// | ||
// Copyright (c) 2024 Jeff Garzik | ||
// | ||
// This file is part of the posixutils-rs project covered under | ||
// the MIT License. For the full license text, please see the LICENSE | ||
// file in the root directory of this project. | ||
// SPDX-License-Identifier: MIT | ||
// | ||
|
||
use plib::{run_test, TestPlan}; | ||
|
||
fn cksum_test(test_data: &str, expected_output: &str) { | ||
run_test(TestPlan { | ||
cmd: String::from("cksum"), | ||
args: Vec::new(), | ||
stdin_data: String::from(test_data), | ||
expected_out: String::from(expected_output), | ||
}); | ||
} | ||
|
||
#[test] | ||
fn test_cksum() { | ||
cksum_test("foo\n", "3915528286 4\n"); | ||
} |