Skip to content

Commit

Permalink
style: run ./lint.sh --mode=fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ologbonowiwi committed Jan 29, 2024
1 parent 7dc62fd commit 88f3a1b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 41 deletions.
6 changes: 5 additions & 1 deletion src/blueprint/operators/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ impl TryFrom<Expression> for Grpc {
fn get_type_and_field(call: &config::Call) -> Option<(String, String)> {
if let Some(query) = &call.query {
Some(("Query".to_string(), query.clone()))
} else { call.mutation.as_ref().map(|mutation| ("Mutation".to_string(), mutation.clone())) }
} else {
call.mutation
.as_ref()
.map(|mutation| ("Mutation".to_string(), mutation.clone()))
}
}

pub fn compile_call(
Expand Down
80 changes: 40 additions & 40 deletions src/blueprint/operators/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,27 +496,27 @@ mod tests {
let expected = json!(0);

let actual = Expr::eval(
json!({"body": {"cond": [{"const": 0}, [[{"const": false}, {"const": 1}], [{"const": false}, {"const": 2}]]]}}),
)
.await
.unwrap();
json!({"body": {"cond": [{"const": 0}, [[{"const": false}, {"const": 1}], [{"const": false}, {"const": 2}]]]}}),
)
.await

Check warning on line 501 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L501

Added line #L501 was not covered by tests
.unwrap();
assert_eq!(actual, expected);

let expected = json!(1);

let actual = Expr::eval(
json!({"body": {"cond": [{"const": 0}, [[{"const": true}, {"const": 1}], [{"const": true}, {"const": 2}]]]}}),
)
.await
.unwrap();
json!({"body": {"cond": [{"const": 0}, [[{"const": true}, {"const": 1}], [{"const": true}, {"const": 2}]]]}}),
)
.await

Check warning on line 510 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L510

Added line #L510 was not covered by tests
.unwrap();
assert_eq!(actual, expected);

let expected = json!(2);
let actual = Expr::eval(
json!({"body": {"cond": [{"const": 0}, [[{"const": false}, {"const": 1}], [{"const": true}, {"const": 2}]]]}}),
)
.await
.unwrap();
json!({"body": {"cond": [{"const": 0}, [[{"const": false}, {"const": 1}], [{"const": true}, {"const": 2}]]]}}),
)
.await

Check warning on line 518 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L518

Added line #L518 was not covered by tests
.unwrap();
assert_eq!(actual, expected);
}

Expand Down Expand Up @@ -560,10 +560,10 @@ mod tests {
async fn test_relation_difference() {
let expected = json!([1]);
let actual = Expr::eval(
json!({"body": {"difference": [[{"const": 1}, {"const": 2}, {"const": 3}], [{"const": 2}, {"const": 3}]]}}),
)
.await
.unwrap();
json!({"body": {"difference": [[{"const": 1}, {"const": 2}, {"const": 3}], [{"const": 2}, {"const": 3}]]}}),
)
.await
.unwrap();

assert_eq!(actual, expected);
}
Expand All @@ -573,17 +573,17 @@ mod tests {
let expected = json!([1]);

let actual = Expr::eval(
json!({"body": {"symmetricDifference": [[{"const": 1}, {"const": 2}, {"const": 3}], [{"const": 2}, {"const": 3}]]}}),
)
.await
.unwrap();
json!({"body": {"symmetricDifference": [[{"const": 1}, {"const": 2}, {"const": 3}], [{"const": 2}, {"const": 3}]]}}),
)
.await

Check warning on line 578 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L578

Added line #L578 was not covered by tests
.unwrap();
assert_eq!(actual, expected);

let actual = Expr::eval(
json!({"body": {"symmetricDifference": [[{"const": 2}, {"const": 3}], [{"const": 1}, {"const": 2}, {"const": 3}]]}}),
)
.await
.unwrap();
json!({"body": {"symmetricDifference": [[{"const": 2}, {"const": 3}], [{"const": 1}, {"const": 2}, {"const": 3}]]}}),
)
.await

Check warning on line 585 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L585

Added line #L585 was not covered by tests
.unwrap();
assert_eq!(actual, expected);
}

Expand Down Expand Up @@ -812,10 +812,10 @@ mod tests {
async fn test_relation_max() {
let expected = json!(923.83);
let actual = Expr::eval(
json!({"body": {"max": [{"const": 1}, {"const": 23}, {"const": -423}, {"const": 0}, {"const": 923.83}]}}),
)
.await
.unwrap();
json!({"body": {"max": [{"const": 1}, {"const": 23}, {"const": -423}, {"const": 0}, {"const": 923.83}]}}),
)
.await
.unwrap();
assert_eq!(actual, expected);

let expected = json!("z");
Expand All @@ -828,21 +828,21 @@ mod tests {

let expected = json!([2, 3]);
let actual = Expr::eval(
json!({"body": {"max": [{"const": [2, 3]}, {"const": [0, 1, 2]}, {"const": [-1, 0, 0, 0]}, {"const": [1]}]}}),
)
.await
.unwrap();
json!({"body": {"max": [{"const": [2, 3]}, {"const": [0, 1, 2]}, {"const": [-1, 0, 0, 0]}, {"const": [1]}]}}),
)
.await

Check warning on line 833 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L833

Added line #L833 was not covered by tests
.unwrap();
assert_eq!(actual, expected);
}

#[tokio::test]
async fn test_relation_min() {
let expected = json!(-423);
let actual = Expr::eval(
json!({"body": {"min": [{"const": 1}, {"const": 23}, {"const": -423}, {"const": 0}, {"const": 923.83}]}}),
)
.await
.unwrap();
json!({"body": {"min": [{"const": 1}, {"const": 23}, {"const": -423}, {"const": 0}, {"const": 923.83}]}}),
)
.await
.unwrap();
assert_eq!(actual, expected);

let expected = json!("abc");
Expand All @@ -855,10 +855,10 @@ mod tests {

let expected = json!([-1, 0, 0, 0]);
let actual = Expr::eval(
json!({"body": {"min": [{"const": [2, 3]}, {"const": [0, 1, 2]}, {"const": [-1, 0, 0, 0]}, {"const": [1]}]}}),
)
.await
.unwrap();
json!({"body": {"min": [{"const": [2, 3]}, {"const": [0, 1, 2]}, {"const": [-1, 0, 0, 0]}, {"const": [1]}]}}),
)
.await

Check warning on line 860 in src/blueprint/operators/expr.rs

View check run for this annotation

Codecov / codecov/patch

src/blueprint/operators/expr.rs#L860

Added line #L860 was not covered by tests
.unwrap();
assert_eq!(actual, expected);
}

Expand Down

0 comments on commit 88f3a1b

Please sign in to comment.