Keep a test's doc comment attached to its test
Adding the test_auth helper put it between `/// The URL shape confirmed from a real H2C's ipcam block.` and the test that comment describes, so the comment documented the helper instead. Clippy's empty_line_after_doc_comments caught it. Also takes clippy's from_ref over a clone in the new render-stability test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+3
-3
@@ -379,14 +379,14 @@ mod tests {
|
||||
))
|
||||
}
|
||||
|
||||
/// The URL shape confirmed from a real H2C's `ipcam` block.
|
||||
|
||||
/// A fixed credential, so the byte-identical assertions below stay
|
||||
/// meaningful. A real one is 32 random bytes and would make every
|
||||
/// rendered config differ from every other.
|
||||
fn test_auth() -> ApiAuth {
|
||||
ApiAuth { username: "continuum".into(), password: "test-password".into() }
|
||||
}
|
||||
|
||||
/// The URL shape confirmed from a real H2C's `ipcam` block.
|
||||
#[test]
|
||||
fn a_reported_rtsps_url_gets_the_printer_credentials_spliced_in() {
|
||||
let source = source_for(&printer("h2c"), Some("rtsps://192.168.0.21:322/streaming/live/1"))
|
||||
@@ -506,7 +506,7 @@ mod tests {
|
||||
fn the_same_fleet_and_credential_render_identically() {
|
||||
let source = CameraSource { stream_name: "h2c".into(), url: "rtsps://x".into() };
|
||||
assert_eq!(
|
||||
render_config(":1984", &[source.clone()], &test_auth()),
|
||||
render_config(":1984", std::slice::from_ref(&source), &test_auth()),
|
||||
render_config(":1984", &[source], &test_auth()),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user