mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Merge pull request #5559 from pawelngei/expr-substr-error
expr: different stderr with `expr "56" "substr"`
This commit is contained in:
commit
af021e0d4f
2 changed files with 22 additions and 4 deletions
|
@ -6,6 +6,14 @@
|
|||
|
||||
use crate::common::util::TestScenario;
|
||||
|
||||
#[test]
|
||||
fn test_no_arguments() {
|
||||
new_ucmd!()
|
||||
.fails()
|
||||
.code_is(2)
|
||||
.stderr_only("expr: missing operand\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_values() {
|
||||
// null or 0 => EXIT_VALUE == 1
|
||||
|
@ -295,6 +303,12 @@ fn test_substr() {
|
|||
|
||||
#[test]
|
||||
fn test_invalid_substr() {
|
||||
new_ucmd!()
|
||||
.args(&["56", "substr"])
|
||||
.fails()
|
||||
.code_is(2)
|
||||
.stderr_only("expr: syntax error: unexpected argument 'substr'\n");
|
||||
|
||||
new_ucmd!()
|
||||
.args(&["substr", "abc", "0", "1"])
|
||||
.fails()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue