Skip to content

Commit

Permalink
chore: cargo fmt + clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeshbhusal committed Oct 4, 2024
1 parent 13cf67e commit fe0daa5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
7 changes: 5 additions & 2 deletions packages/hurl/src/jsonpath/parser/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ fn predicate_func(reader: &mut Reader) -> ParseResult<PredicateFunc> {
equal_boolean_predicate_func,
equal_string_predicate_func,
notequal_string_predicate_func,
notequal_number_func
notequal_number_func,
],
reader,
)
Expand Down Expand Up @@ -668,7 +668,10 @@ mod tests {
let mut reader = Reader::new("!=2.5");
assert_eq!(
predicate_func(&mut reader).unwrap(),
PredicateFunc::NotEqual(Number { int: 2, decimal: 500_000_000_000_000_000 })
PredicateFunc::NotEqual(Number {
int: 2,
decimal: 500_000_000_000_000_000
})
);

let mut reader = Reader::new(">5");
Expand Down
13 changes: 2 additions & 11 deletions packages/hurl/src/jsonpath/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,25 +257,16 @@ fn test_bookstore_path() {
let expr = jsonpath::parse("$..book[?(@.title!='Moby Dick')]").unwrap();
assert_eq!(
expr.eval(&bookstore_value()).unwrap(),
JsonpathResult::Collection(vec![
book0_value(),
book1_value(),
book3_value()
])
JsonpathResult::Collection(vec![book0_value(), book1_value(), book3_value()])
);

// get all books whose price is not 8.95 (first book)
let expr = jsonpath::parse("$..book[?(@.price!=8.95)]").unwrap();
assert_eq!(
expr.eval(&bookstore_value()).unwrap(),
JsonpathResult::Collection(vec![
book1_value(),
book2_value(),
book3_value()
])
JsonpathResult::Collection(vec![book1_value(), book2_value(), book3_value()])
);


// All members of JSON structure
let expr = jsonpath::parse("$..*").unwrap();
// Order is reproducible
Expand Down

0 comments on commit fe0daa5

Please sign in to comment.