Skip to content

Commit

Permalink
expr: add missing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Jan 11, 2025
1 parent e7f6b23 commit b241602
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/by-util/test_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ fn test_complex_arithmetic() {
.stderr_only("expr: division by zero\n");
}

#[test]
fn test_missing_argument() {
new_ucmd!()
.args(&["2", "+"])
.fails()
.code_is(2)
.stderr_only("expr: syntax error: missing argument after '+'\n");

new_ucmd!()
.args(&["length"])
.fails()
.code_is(2)
.stderr_only("expr: syntax error: missing argument after 'length'\n");
}

#[test]
fn test_parenthesis() {
new_ucmd!()
Expand Down

0 comments on commit b241602

Please sign in to comment.