Skip to content

Commit

Permalink
expr: Minor linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sargas committed Apr 4, 2024
1 parent 1ea6db8 commit 6e38843
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/uu/expr/src/syntax_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,12 @@ fn validate_regex(pattern: &str) -> ExprResult<()> {
invalid_content_error = true;

Check warning on line 211 in src/uu/expr/src/syntax_tree.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/expr/src/syntax_tree.rs#L211

Added line #L211 was not covered by tests
}
(Some(x), None) | (Some(x), Some("")) => {
if !x.parse::<i16>().is_ok() {
if x.parse::<i16>().is_err() {
invalid_content_error = true;
}
}
(None, Some(x)) | (Some(""), Some(x)) => {
if !x.parse::<i16>().is_ok() {
if x.parse::<i16>().is_err() {
invalid_content_error = true;

Check warning on line 220 in src/uu/expr/src/syntax_tree.rs

View check run for this annotation

Codecov / codecov/patch

src/uu/expr/src/syntax_tree.rs#L220

Added line #L220 was not covered by tests
}
}
Expand Down Expand Up @@ -706,13 +706,13 @@ mod test {

#[test]
fn starting_stars_become_escaped() {
let result = AstNode::parse(&["yolo", ":", r"*yolo"])
let result = AstNode::parse(&["cats", ":", r"*cats"])
.unwrap()
.eval()
.unwrap();
assert_eq!(result.eval_as_string(), "0");

let result = AstNode::parse(&["*yolo", ":", r"*yolo"])
let result = AstNode::parse(&["*cats", ":", r"*cats"])
.unwrap()
.eval()
.unwrap();
Expand Down

0 comments on commit 6e38843

Please sign in to comment.