Skip to content

Commit 1727983

Browse files
committed
Add testcase
1 parent 77185b2 commit 1727983

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

crates/vespera_macro/src/schema_macro/file_cache.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,4 +501,14 @@ mod tests {
501501
unsafe { std::env::remove_var("VESPERA_PROFILE") };
502502
// Test passes if no panic — output goes to stderr
503503
}
504+
505+
#[serial_test::serial]
506+
#[test]
507+
fn test_print_profile_summary_without_profile_env() {
508+
// Ensure VESPERA_PROFILE is not set
509+
unsafe { std::env::remove_var("VESPERA_PROFILE") };
510+
511+
// Should early-return at line 308 without printing anything
512+
print_profile_summary();
513+
}
504514
}

examples/axum-example/src/routes/form.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ pub async fn subscribe(Form(input): Form<SubscribeRequest>) -> Json<SubscribeRes
5454
pub async fn contact(Form(input): Form<ContactFormRequest>) -> Json<ContactFormResponse> {
5555
Json(ContactFormResponse {
5656
success: true,
57-
ticket_id: format!("TICKET-{}-{}", input.name.len() + input.message.len(), input.email.len() + input.subject.as_deref().map_or(0, str::len)),
57+
ticket_id: format!(
58+
"TICKET-{}-{}",
59+
input.name.len() + input.message.len(),
60+
input.email.len() + input.subject.as_deref().map_or(0, str::len)
61+
),
5862
})
5963
}
6064

examples/axum-example/src/routes/users.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ pub async fn skip_response() -> Json<SkipResponse> {
208208
)])),
209209
};
210210
// Read skip fields to validate they're populated correctly
211-
let _ = (&response.email, &response.email2, &response.email3, &response.email7);
211+
let _ = (
212+
&response.email,
213+
&response.email2,
214+
&response.email3,
215+
&response.email7,
216+
);
212217
Json(response)
213218
}

0 commit comments

Comments
 (0)