diff --git a/.changepacks/changepack_log__6nhIr--nPX_qMjZ0zvOt.json b/.changepacks/changepack_log__6nhIr--nPX_qMjZ0zvOt.json new file mode 100644 index 00000000..8278d7ae --- /dev/null +++ b/.changepacks/changepack_log__6nhIr--nPX_qMjZ0zvOt.json @@ -0,0 +1,9 @@ +{ + "changes": { + "Cargo.toml": "Patch", + "libs/vespera-bridge/build.gradle.kts": "Patch", + "libs/vespera-bridge-gradle-plugin/build.gradle.kts": "Patch" + }, + "note": "Test assertions satisfy clippy's assert_is_empty lint (Rust 1.99)", + "date": "2026-10-30T12:02:02.505707500Z" +} \ No newline at end of file diff --git a/crates/vespera_core/src/schema/tests.rs b/crates/vespera_core/src/schema/tests.rs index cb62b14a..0a6cd6d2 100644 --- a/crates/vespera_core/src/schema/tests.rs +++ b/crates/vespera_core/src/schema/tests.rs @@ -33,7 +33,7 @@ fn object_helper_initializes_collections() { let props = schema.properties.expect("properties should be initialized"); assert!(props.is_empty()); let required = schema.required.expect("required should be initialized"); - assert!(required.is_empty()); + assert!(required.is_empty(), "{required:?}"); } #[test] diff --git a/crates/vespera_inprocess/src/streaming/tests.rs b/crates/vespera_inprocess/src/streaming/tests.rs index 8148acd4..f6640ba2 100644 --- a/crates/vespera_inprocess/src/streaming/tests.rs +++ b/crates/vespera_inprocess/src/streaming/tests.rs @@ -104,7 +104,7 @@ async fn validation_body_error_commits_a_complete_500_header() { assert_eq!(outcome, StreamOutcome::Complete); assert_eq!(decode_status(&header), 500); - assert!(chunks.is_empty()); + assert!(chunks.is_empty(), "expected an empty value"); } #[tokio::test] diff --git a/crates/vespera_inprocess/src/wire/header_read.rs b/crates/vespera_inprocess/src/wire/header_read.rs index 6d2415af..f8e21755 100644 --- a/crates/vespera_inprocess/src/wire/header_read.rs +++ b/crates/vespera_inprocess/src/wire/header_read.rs @@ -806,6 +806,6 @@ mod tests { assert_eq!(stack.depth, 0); assert!(stack.top().is_none()); - assert!(stack.overflow.is_empty()); + assert!(stack.overflow.is_empty(), "expected an empty value"); } } diff --git a/crates/vespera_inprocess/tests/streaming_with_header.rs b/crates/vespera_inprocess/tests/streaming_with_header.rs index 9d9379ca..ec1f3e39 100644 --- a/crates/vespera_inprocess/tests/streaming_with_header.rs +++ b/crates/vespera_inprocess/tests/streaming_with_header.rs @@ -503,7 +503,7 @@ async fn bidirectional_with_header_error_on_short_input() { let (header_json, body) = decode_wire(&header_buf.lock().unwrap()); assert_eq!(header_json["status"].as_u64(), Some(400)); - assert!(!body.is_empty()); + assert!(!body.is_empty(), "expected a non-empty value"); assert!(body_buf.lock().unwrap().is_empty()); } diff --git a/crates/vespera_macro/src/garde_emit/tests.rs b/crates/vespera_macro/src/garde_emit/tests.rs index 3441de7e..924b2ec8 100644 --- a/crates/vespera_macro/src/garde_emit/tests.rs +++ b/crates/vespera_macro/src/garde_emit/tests.rs @@ -33,7 +33,7 @@ fn no_constraints_emits_nothing() { pub age: i32, } }; - assert!(emit_to_string(s).is_empty()); + assert!(emit_to_string(s).is_empty(), "expected an empty value"); } #[test] @@ -201,7 +201,7 @@ fn format_uuid_is_annotation_only_no_runtime_rule() { } }; // uuid alone has no garde rule → no Validate impl emitted. - assert!(emit_to_string(s).is_empty()); + assert!(emit_to_string(s).is_empty(), "expected an empty value"); } #[test] @@ -234,7 +234,7 @@ fn enum_emits_nothing() { let e: DeriveInput = parse_quote! { enum Status { Active, Inactive } }; - assert!(emit_to_string(e).is_empty()); + assert!(emit_to_string(e).is_empty(), "expected an empty value"); } #[test] @@ -242,7 +242,7 @@ fn tuple_struct_emits_nothing() { let s: DeriveInput = parse_quote! { struct Wrapper(pub String); }; - assert!(emit_to_string(s).is_empty()); + assert!(emit_to_string(s).is_empty(), "expected an empty value"); } #[test] @@ -250,7 +250,7 @@ fn unit_struct_emits_nothing() { let s: DeriveInput = parse_quote! { struct Empty; }; - assert!(emit_to_string(s).is_empty()); + assert!(emit_to_string(s).is_empty(), "expected an empty value"); } #[test] @@ -278,7 +278,7 @@ fn annotation_only_constraints_emit_nothing() { pub id: String, } }; - assert!(emit_to_string(s).is_empty()); + assert!(emit_to_string(s).is_empty(), "expected an empty value"); } // ── nested validation (`#[schema(dive)]`) emission ────────────── @@ -363,7 +363,7 @@ fn dive_false_disables_emission() { }; // `dive = false` is the same as no annotation — no rule // produced means no `impl Validate` emitted. - assert!(emit_to_string(s).is_empty()); + assert!(emit_to_string(s).is_empty(), "expected an empty value"); } // ── format=ipv6 / format=ip / unknown format ──────────────────── diff --git a/crates/vespera_macro/src/route_impl.rs b/crates/vespera_macro/src/route_impl.rs index 591c84aa..6bae187c 100644 --- a/crates/vespera_macro/src/route_impl.rs +++ b/crates/vespera_macro/src/route_impl.rs @@ -519,7 +519,7 @@ mod tests { assert_eq!(stored.tags, Some(vec!["users".to_string()])); assert_eq!(stored.description, Some("Get user by ID".to_string())); assert_eq!(stored.error_status, Some(vec![404])); - assert!(stored.headers.is_empty()); + assert!(stored.headers.is_empty(), "expected an empty value"); assert!(stored.fn_sig_str.contains("get_user_test_storage")); } @@ -544,7 +544,7 @@ mod tests { assert_eq!(stored.tags, None); assert_eq!(stored.description, None); assert_eq!(stored.error_status, None); - assert!(stored.headers.is_empty()); + assert!(stored.headers.is_empty(), "expected an empty value"); } #[test] diff --git a/crates/vespera_macro/src/router_codegen/input_tests.rs b/crates/vespera_macro/src/router_codegen/input_tests.rs index c2f019db..9e058daf 100644 --- a/crates/vespera_macro/src/router_codegen/input_tests.rs +++ b/crates/vespera_macro/src/router_codegen/input_tests.rs @@ -389,7 +389,10 @@ fn test_process_vespera_input_defaults() { let input: AutoRouterInput = syn::parse2(tokens).unwrap(); let processed = process_vespera_input(input); assert_eq!(processed.folder_name, "routes"); - assert!(processed.openapi_file_names.is_empty()); + assert!( + processed.openapi_file_names.is_empty(), + "expected an empty value" + ); assert!(processed.title.is_none()); assert!(processed.docs_url.is_none()); } @@ -460,7 +463,7 @@ fn test_parse_merge_values_empty() { let tokens = quote::quote!(merge = []); let input: AutoRouterInput = syn::parse2(tokens).unwrap(); let merge = input.merge.unwrap(); - assert!(merge.is_empty()); + assert!(merge.is_empty(), "expected an empty value"); } #[test] diff --git a/crates/vespera_macro/src/schema_assertions.rs b/crates/vespera_macro/src/schema_assertions.rs index 3f2823ac..07fef9bb 100644 --- a/crates/vespera_macro/src/schema_assertions.rs +++ b/crates/vespera_macro/src/schema_assertions.rs @@ -411,19 +411,31 @@ mod tests { #[test] fn leaf_of_non_path_type_is_empty() { // References, slices, tuples produce no leaf to assert on. - assert!(collect_leaf_custom_types(&parse_ty("(i32, String)")).is_empty()); - assert!(collect_leaf_custom_types(&parse_ty("&MyType")).is_empty()); + assert!( + collect_leaf_custom_types(&parse_ty("(i32, String)")).is_empty(), + "expected an empty value" + ); + assert!( + collect_leaf_custom_types(&parse_ty("&MyType")).is_empty(), + "expected an empty value" + ); } #[test] fn leaf_of_empty_wrapper_is_empty() { // `Vec` with no type args (degenerate) has no leaf. - assert!(collect_leaf_custom_types(&parse_ty("Vec")).is_empty()); + assert!( + collect_leaf_custom_types(&parse_ty("Vec")).is_empty(), + "expected an empty value" + ); } #[test] fn leaf_of_empty_path_is_empty() { - assert!(collect_leaf_custom_types(&empty_path_type()).is_empty()); + assert!( + collect_leaf_custom_types(&empty_path_type()).is_empty(), + "expected an empty value" + ); } #[test] @@ -701,7 +713,8 @@ mod tests { assert!( emit_field_assertions(&input, &constraints_for(&input)) .to_string() - .is_empty() + .is_empty(), + "expected an empty value" ); let input: syn::DeriveInput = parse_quote! { @@ -710,7 +723,8 @@ mod tests { assert!( emit_field_assertions(&input, &constraints_for(&input)) .to_string() - .is_empty() + .is_empty(), + "expected an empty value" ); let input: syn::DeriveInput = parse_quote! { @@ -719,7 +733,8 @@ mod tests { assert!( emit_field_assertions(&input, &constraints_for(&input)) .to_string() - .is_empty() + .is_empty(), + "expected an empty value" ); } } diff --git a/crates/vespera_macro/src/schema_macro/circular/tests.rs b/crates/vespera_macro/src/schema_macro/circular/tests.rs index 934e4e28..2f8201b3 100644 --- a/crates/vespera_macro/src/schema_macro/circular/tests.rs +++ b/crates/vespera_macro/src/schema_macro/circular/tests.rs @@ -42,7 +42,8 @@ fn test_detect_circular_fields_invalid_struct() { assert!( analyze_circular_refs(&["crate".to_string()], "not valid rust") .circular_fields - .is_empty() + .is_empty(), + "expected an empty value" ); } @@ -56,7 +57,8 @@ fn test_detect_circular_fields_unnamed_fields() { assert!( analyze_circular_refs(&path, "pub struct TupleStruct(i32, String);") .circular_fields - .is_empty() + .is_empty(), + "expected an empty value" ); } @@ -346,7 +348,8 @@ fn test_circular_fields_empty_module_path() { assert!( analyze_circular_refs(&[], "pub struct Schema { pub id: i32 }") .circular_fields - .is_empty() + .is_empty(), + "expected an empty value" ); } @@ -390,7 +393,8 @@ fn test_circular_fields_field_without_ident() { assert!( analyze_circular_refs(&path, r"pub struct Schema { pub id: i32, }") .circular_fields - .is_empty() + .is_empty(), + "expected an empty value" ); } diff --git a/crates/vespera_macro/src/schema_macro/file_lookup/lookup/tests.rs b/crates/vespera_macro/src/schema_macro/file_lookup/lookup/tests.rs index 06f4a7b0..766c520a 100644 --- a/crates/vespera_macro/src/schema_macro/file_lookup/lookup/tests.rs +++ b/crates/vespera_macro/src/schema_macro/file_lookup/lookup/tests.rs @@ -115,14 +115,14 @@ fn test_collect_rs_files_recursive_empty_dir() { let temp_dir = TempDir::new().unwrap(); let mut files = Vec::new(); collect_rs_files_recursive(temp_dir.path(), &mut files); - assert!(files.is_empty()); + assert!(files.is_empty(), "expected an empty value"); } #[test] fn test_collect_rs_files_recursive_nonexistent_dir() { let mut files = Vec::new(); collect_rs_files_recursive(Path::new("/nonexistent/path"), &mut files); - assert!(files.is_empty()); + assert!(files.is_empty(), "expected an empty value"); } #[test] diff --git a/crates/vespera_macro/src/schema_macro/inline_types/tests.rs b/crates/vespera_macro/src/schema_macro/inline_types/tests.rs index a5fc3323..cbf76cb0 100644 --- a/crates/vespera_macro/src/schema_macro/inline_types/tests.rs +++ b/crates/vespera_macro/src/schema_macro/inline_types/tests.rs @@ -178,7 +178,7 @@ fn inline_field_struct_holds_constructor_inputs() { vec![syn::parse_quote!(#[doc = "Test doc"])], ); assert_eq!(field.name.to_string(), "test_field"); - assert!(!field.attrs.is_empty()); + assert!(!field.attrs.is_empty(), "expected a non-empty value"); } #[test] diff --git a/crates/vespera_macro/src/schema_macro/input.rs b/crates/vespera_macro/src/schema_macro/input.rs index d02f1a19..6a6f9ac2 100644 --- a/crates/vespera_macro/src/schema_macro/input.rs +++ b/crates/vespera_macro/src/schema_macro/input.rs @@ -461,7 +461,10 @@ mod tests { assert!(input.omit.is_none()); assert!(input.pick.is_none()); assert!(input.rename.is_none()); - assert!(input.relation_adapters.is_empty()); + assert!( + input.relation_adapters.is_empty(), + "expected an empty value" + ); assert!(input.derive_clone); } diff --git a/crates/vespera_macro/src/schema_macro/transformation/tests.rs b/crates/vespera_macro/src/schema_macro/transformation/tests.rs index 5d17340e..f480e01c 100644 --- a/crates/vespera_macro/src/schema_macro/transformation/tests.rs +++ b/crates/vespera_macro/src/schema_macro/transformation/tests.rs @@ -227,7 +227,7 @@ fn test_extract_form_data_attrs_empty() { ]; let form_data = extract_form_data_attrs(&attrs); - assert!(form_data.is_empty()); + assert!(form_data.is_empty(), "expected an empty value"); } #[test] diff --git a/crates/vespera_macro/src/schema_macro/type_utils/tests.rs b/crates/vespera_macro/src/schema_macro/type_utils/tests.rs index 9dd783a6..1bd662ce 100644 --- a/crates/vespera_macro/src/schema_macro/type_utils/tests.rs +++ b/crates/vespera_macro/src/schema_macro/type_utils/tests.rs @@ -185,7 +185,7 @@ fn test_is_seaorm_model_regular_struct() { fn test_extract_module_path_simple() { let ty: syn::Type = syn::parse_str("User").unwrap(); let result = extract_module_path(&ty); - assert!(result.is_empty()); + assert!(result.is_empty(), "expected an empty value"); } #[test] @@ -199,7 +199,7 @@ fn test_extract_module_path_qualified() { fn test_extract_module_path_non_path_type() { let ty: syn::Type = syn::parse_str("&str").unwrap(); let result = extract_module_path(&ty); - assert!(result.is_empty()); + assert!(result.is_empty(), "expected an empty value"); } #[test] @@ -316,7 +316,7 @@ fn test_resolve_type_to_absolute_path_empty_segments() { let module_path = vec!["crate".to_string()]; let tokens = resolve_type_to_absolute_path(&ty, &module_path); let output = tokens.to_string(); - assert!(output.trim().is_empty()); + assert!(output.trim().is_empty(), "expected an empty value"); } #[rstest] @@ -509,7 +509,10 @@ fn test_resolve_type_to_absolute_path_leading_colon_and_empty_path() { let empty_ty = empty_type_path(); let tokens = resolve_type_to_absolute_path(&empty_ty, &["crate".to_string()]); - assert!(tokens.to_string().trim().is_empty()); + assert!( + tokens.to_string().trim().is_empty(), + "expected an empty value" + ); } #[test]