Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jun 19, 2024
1 parent d987529 commit 90d7bce
Showing 1 changed file with 13 additions and 39 deletions.
52 changes: 13 additions & 39 deletions tooling/nargo_cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,10 @@ fn generate_execution_success_tests(test_file: &mut File, test_data_dir: &Path)
test_type,
&test_name,
&test_dir,
&format!(
r#"
r#"
nargo.arg("execute").arg("--force");
nargo.assert().success();"#,
),
);

if !IGNORED_NEW_FEATURE_TESTS.contains(&test_name.as_str()) {
Expand All @@ -132,12 +130,10 @@ fn generate_execution_success_tests(test_file: &mut File, test_data_dir: &Path)
test_type,
&format!("legacy_{test_name}"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("execute").arg("--force").arg("--use-legacy");
nargo.assert().success();"#,
),
);
}

Expand All @@ -147,12 +143,10 @@ fn generate_execution_success_tests(test_file: &mut File, test_data_dir: &Path)
test_type,
&format!("{test_name}_brillig"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("execute").arg("--force").arg("--force-brillig");
nargo.assert().success();"#,
),
);
}
}
Expand All @@ -169,25 +163,21 @@ fn generate_execution_failure_tests(test_file: &mut File, test_data_dir: &Path)
test_type,
&test_name,
&test_dir,
&format!(
r#"
r#"
nargo.arg("execute").arg("--force");
nargo.assert().failure().stderr(predicate::str::contains("The application panicked (crashed).").not());"#,
),
);

generate_test_case(
test_file,
test_type,
&format!("legacy_{test_name}"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("execute").arg("--force").arg("--use-legacy");
nargo.assert().failure().stderr(predicate::str::contains("The application panicked (crashed).").not());"#,
),
);
}
}
Expand All @@ -203,25 +193,21 @@ fn generate_noir_test_success_tests(test_file: &mut File, test_data_dir: &Path)
test_type,
&test_name,
&test_dir,
&format!(
r#"
r#"
nargo.arg("test");
nargo.assert().success();"#,
),
);

generate_test_case(
test_file,
test_type,
&format!("legacy_{test_name}"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("test").arg("--use-legacy");
nargo.assert().success();"#,
),
);
}
}
Expand All @@ -236,25 +222,21 @@ fn generate_noir_test_failure_tests(test_file: &mut File, test_data_dir: &Path)
test_type,
&test_name,
&test_dir,
&format!(
r#"
r#"
nargo.arg("test");
nargo.assert().failure();"#,
),
);

generate_test_case(
test_file,
test_type,
&format!("legacy_{test_name}"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("test").arg("--use-legacy");
nargo.assert().failure();"#,
),
);
}
}
Expand Down Expand Up @@ -321,25 +303,21 @@ fn generate_compile_success_contract_tests(test_file: &mut File, test_data_dir:
test_type,
&test_name,
&test_dir,
&format!(
r#"
r#"
nargo.arg("compile").arg("--force");
nargo.assert().success();"#,
),
);

generate_test_case(
test_file,
test_type,
&format!("legacy_{test_name}"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("compile").arg("--force").arg("--use-legacy");
nargo.assert().success();"#,
),
);
}
}
Expand All @@ -355,11 +333,9 @@ fn generate_compile_failure_tests(test_file: &mut File, test_data_dir: &Path) {
test_type,
&test_name,
&test_dir,
&format!(
r#"nargo.arg("compile").arg("--force");
r#"nargo.arg("compile").arg("--force");
nargo.assert().failure().stderr(predicate::str::contains("The application panicked (crashed).").not());"#,
),
);

if !IGNORED_NEW_FEATURE_TESTS.contains(&test_name.as_str()) {
Expand All @@ -368,12 +344,10 @@ fn generate_compile_failure_tests(test_file: &mut File, test_data_dir: &Path) {
test_type,
&format!("legacy_{test_name}"),
&test_dir,
&format!(
r#"
r#"
nargo.arg("compile").arg("--force").arg("--use-legacy");
nargo.assert().failure().stderr(predicate::str::contains("The application panicked (crashed).").not());"#,
),
);
}
}
Expand Down

0 comments on commit 90d7bce

Please sign in to comment.