treewide: enforce strict clippy check
This commit is contained in:
@@ -402,17 +402,15 @@ fn fixed_output_sha256_flat() {
|
||||
|
||||
#[test_log::test]
|
||||
fn fixed_output_missing_hashalgo() {
|
||||
assert!(
|
||||
eval_deep_result(
|
||||
r#"derivation {
|
||||
eval_deep_result(
|
||||
r#"derivation {
|
||||
name = "default";
|
||||
builder = "/bin/sh";
|
||||
system = "x86_64-linux";
|
||||
outputHash = "0000000000000000000000000000000000000000000000000000000000000000";
|
||||
}"#,
|
||||
)
|
||||
.is_err()
|
||||
);
|
||||
)
|
||||
.unwrap_err();
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
|
||||
@@ -350,7 +350,7 @@ fn read_dir_nonexistent_fails() {
|
||||
let expr = r#"builtins.readDir "/nonexistent/directory""#;
|
||||
let result = eval_result(expr);
|
||||
|
||||
assert!(result.is_err());
|
||||
result.unwrap_err();
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
|
||||
+18
-7
@@ -5,6 +5,7 @@ use std::path::PathBuf;
|
||||
use fix::Evaluator;
|
||||
use fix_error::{Source, SourceType};
|
||||
use fix_lang::Value;
|
||||
use serial_test::serial;
|
||||
|
||||
fn get_lang_dir() -> PathBuf {
|
||||
PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/tests/lang")
|
||||
@@ -160,9 +161,14 @@ mod okay {
|
||||
eval_okay_test!(getattrpos);
|
||||
eval_okay_test!(getattrpos_functionargs);
|
||||
eval_okay_test!(getattrpos_undefined);
|
||||
eval_okay_test!(getenv, || {
|
||||
unsafe { std::env::set_var("TEST_VAR", "foo") };
|
||||
});
|
||||
eval_okay_test!(
|
||||
#[serial(env)]
|
||||
getenv,
|
||||
|| {
|
||||
// SAFETY: guarded with #[serial_test::serial]
|
||||
unsafe { std::env::set_var("TEST_VAR", "foo") };
|
||||
}
|
||||
);
|
||||
eval_okay_test!(groupBy);
|
||||
eval_okay_test!(r#if);
|
||||
eval_okay_test!(ind_string);
|
||||
@@ -194,11 +200,16 @@ mod okay {
|
||||
eval_okay_test!(partition);
|
||||
eval_okay_test!(path);
|
||||
eval_okay_test!(pathexists);
|
||||
eval_okay_test!(path_string_interpolation, || {
|
||||
unsafe {
|
||||
std::env::set_var("HOME", "/fake-home");
|
||||
eval_okay_test!(
|
||||
#[serial(env)]
|
||||
path_string_interpolation,
|
||||
|| {
|
||||
// SAFETY: guarded with #[serial_test::serial]
|
||||
unsafe {
|
||||
std::env::set_var("HOME", "/fake-home");
|
||||
}
|
||||
}
|
||||
});
|
||||
);
|
||||
eval_okay_test!(patterns);
|
||||
eval_okay_test!(print);
|
||||
eval_okay_test!(readDir);
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
#![allow(clippy::allow_attributes_without_reason)]
|
||||
#![allow(
|
||||
dead_code,
|
||||
clippy::unwrap_used,
|
||||
clippy::unwrap_in_result,
|
||||
clippy::panic
|
||||
)]
|
||||
|
||||
mod derivation;
|
||||
mod findfile;
|
||||
mod io_operations;
|
||||
|
||||
@@ -348,7 +348,7 @@ fn substring_zero_length_empty_value() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn concatStringsSep_preserves_context() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -365,7 +365,7 @@ fn concatStringsSep_preserves_context() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn concatStringsSep_merges_contexts() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -383,7 +383,7 @@ fn concatStringsSep_merges_contexts() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn concatStringsSep_separator_has_context() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -398,7 +398,7 @@ fn concatStringsSep_separator_has_context() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn replaceStrings_input_context_preserved() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -413,7 +413,7 @@ fn replaceStrings_input_context_preserved() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn replaceStrings_replacement_context_collected() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -428,7 +428,7 @@ fn replaceStrings_replacement_context_collected() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn replaceStrings_merges_contexts() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -446,7 +446,7 @@ fn replaceStrings_merges_contexts() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn replaceStrings_lazy_evaluation_context() {
|
||||
let result = eval(
|
||||
r#"
|
||||
@@ -461,7 +461,7 @@ fn replaceStrings_lazy_evaluation_context() {
|
||||
}
|
||||
|
||||
#[test_log::test]
|
||||
#[allow(non_snake_case)]
|
||||
#[expect(non_snake_case)]
|
||||
fn baseNameOf_preserves_context() {
|
||||
let result = eval(
|
||||
r#"
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use fix::Evaluator;
|
||||
use fix_error::{Result, Source};
|
||||
use fix_lang::Value;
|
||||
|
||||
Reference in New Issue
Block a user