Conversation
|
GNU testsuite comparison: |
tests/by-util/test_printenv.rs
Outdated
| .stdout_contains("VALUE\n") | ||
| .stdout_does_not_contain("BAR"); |
There was a problem hiding this comment.
I think it's clearer if you simply check for the exact expected output:
| .stdout_contains("VALUE\n") | |
| .stdout_does_not_contain("BAR"); | |
| .stdout_is("VALUE\n"); |
tests/by-util/test_printenv.rs
Outdated
| .stdout_contains("VALUE\n") | ||
| .stdout_does_not_contain("c"); |
There was a problem hiding this comment.
Same here. In addition, I would also ensure that it is a silent error.
| .stdout_contains("VALUE\n") | |
| .stdout_does_not_contain("c"); | |
| .stdout_is("VALUE\n") | |
| .no_stderr(); |
tests/by-util/test_printenv.rs
Outdated
| .arg("FOO") | ||
| .arg("KEY") | ||
| .fails_with_code(1) | ||
| .stdout_contains("VALUE\n"); |
There was a problem hiding this comment.
Same here.
| .stdout_contains("VALUE\n"); | |
| .stdout_is("VALUE\n") | |
| .no_stderr(); |
tests/by-util/test_printenv.rs
Outdated
| .stdout_contains("FOO\x00") | ||
| .stdout_contains("VALUE\x00") | ||
| .stdout_does_not_contain("BAR"); |
There was a problem hiding this comment.
Here I would check for the exact output:
| .stdout_contains("FOO\x00") | |
| .stdout_contains("VALUE\x00") | |
| .stdout_does_not_contain("BAR"); | |
| .stdout_is("FOO\x00VALUE\x00"); |
tests/by-util/test_printenv.rs
Outdated
| new_ucmd!() | ||
| .env("HOME", "FOO") | ||
| .env("KEY", "VALUE") | ||
| .arg("-0") | ||
| .succeeds() | ||
| .stdout_contains("HOME=FOO\x00") | ||
| .stdout_contains("KEY=VALUE\x00"); | ||
|
|
||
| new_ucmd!() | ||
| .env("HOME", "FOO") | ||
| .env("KEY", "VALUE") | ||
| .arg("--null") | ||
| .succeeds() | ||
| .stdout_contains("HOME=FOO\x00") | ||
| .stdout_contains("KEY=VALUE\x00"); |
There was a problem hiding this comment.
Here it might make sense to use a loop over the args so it's easy to see that -0 and --null are the same.
There was a problem hiding this comment.
Fixed. I wrapped it with a loop of ["-0", "--null"]. Thanks for the review
|
Some tests failed due to some Fedora-related issue. It doesn’t seem to be related to my code. |
Yes, that's unrelated. Thanks for your PR! |
* tests/printenv: add more tests * tests/printenv: use clearer checks in tests
Added a few missing tests for the
printenvutility.No code changes, only test additions