Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changepacks/changepack_log__6nhIr--nPX_qMjZ0zvOt.json
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion crates/vespera_core/src/schema/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion crates/vespera_inprocess/src/streaming/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion crates/vespera_inprocess/src/wire/header_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
2 changes: 1 addition & 1 deletion crates/vespera_inprocess/tests/streaming_with_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down
14 changes: 7 additions & 7 deletions crates/vespera_macro/src/garde_emit/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -234,23 +234,23 @@ 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]
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]
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]
Expand Down Expand Up @@ -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 ──────────────
Expand Down Expand Up @@ -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 ────────────────────
Expand Down
4 changes: 2 additions & 2 deletions crates/vespera_macro/src/route_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand All @@ -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]
Expand Down
7 changes: 5 additions & 2 deletions crates/vespera_macro/src/router_codegen/input_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down Expand Up @@ -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]
Expand Down
29 changes: 22 additions & 7 deletions crates/vespera_macro/src/schema_assertions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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! {
Expand All @@ -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! {
Expand All @@ -719,7 +733,8 @@ mod tests {
assert!(
emit_field_assertions(&input, &constraints_for(&input))
.to_string()
.is_empty()
.is_empty(),
"expected an empty value"
);
}
}
12 changes: 8 additions & 4 deletions crates/vespera_macro/src/schema_macro/circular/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
);
}

Expand All @@ -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"
);
}

Expand Down Expand Up @@ -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"
);
}

Expand Down Expand Up @@ -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"
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
5 changes: 4 additions & 1 deletion crates/vespera_macro/src/schema_macro/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
11 changes: 7 additions & 4 deletions crates/vespera_macro/src/schema_macro/type_utils/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down
Loading