mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tests: patch tests to simplify imports
This commit is contained in:
parent
5ce678b1cd
commit
6e23d4e979
63 changed files with 242 additions and 343 deletions
|
@ -2,13 +2,11 @@
|
|||
//
|
||||
// For the full copyright and license information, please view the LICENSE
|
||||
// file that was distributed with this source code.
|
||||
use uutests::util::TestScenario;
|
||||
use uutests::util_name;
|
||||
use uutests::new_ucmd;
|
||||
|
||||
#[test]
|
||||
fn test_get_all() {
|
||||
TestScenario::new(util_name!())
|
||||
.ucmd()
|
||||
new_ucmd!()
|
||||
.env("HOME", "FOO")
|
||||
.env("KEY", "VALUE")
|
||||
.succeeds()
|
||||
|
@ -18,21 +16,15 @@ fn test_get_all() {
|
|||
|
||||
#[test]
|
||||
fn test_get_var() {
|
||||
let result = TestScenario::new(util_name!())
|
||||
.ucmd()
|
||||
new_ucmd!()
|
||||
.env("KEY", "VALUE")
|
||||
.arg("KEY")
|
||||
.succeeds();
|
||||
|
||||
assert!(!result.stdout_str().is_empty());
|
||||
assert_eq!(result.stdout_str().trim(), "VALUE");
|
||||
.succeeds()
|
||||
.stdout_contains("VALUE\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_ignore_equal_var() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
// tested by gnu/tests/misc/printenv.sh
|
||||
let result = scene.ucmd().env("a=b", "c").arg("a=b").fails();
|
||||
|
||||
assert!(result.stdout_str().is_empty());
|
||||
new_ucmd!().env("a=b", "c").arg("a=b").fails().no_stdout();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue