desktop: rustfmt the M10.7a state tests
Four macro-argument splits, applied verbatim from run 2895's cargo fmt --check diff. No logic change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SreJkbxB4gx8pPsu8QbLPi
This commit is contained in:
@@ -148,7 +148,10 @@ mod tests {
|
||||
set_link(&conn, "https://notes.example.com", "tok-1").expect("link");
|
||||
let state = read(&conn).expect("read");
|
||||
assert!(state.is_linked());
|
||||
assert_eq!(state.server_url.as_deref(), Some("https://notes.example.com"));
|
||||
assert_eq!(
|
||||
state.server_url.as_deref(),
|
||||
Some("https://notes.example.com")
|
||||
);
|
||||
assert_eq!(state.device_token.as_deref(), Some("tok-1"));
|
||||
}
|
||||
|
||||
@@ -160,7 +163,10 @@ mod tests {
|
||||
// e.g. the token was revoked and the user re-authenticated.
|
||||
set_link(&conn, "https://a.example.com", "tok-2").expect("relink");
|
||||
let state = read(&conn).expect("read");
|
||||
assert_eq!(state.last_cursor, 4242, "a re-auth shouldn't force a full re-sync");
|
||||
assert_eq!(
|
||||
state.last_cursor, 4242,
|
||||
"a re-auth shouldn't force a full re-sync"
|
||||
);
|
||||
assert_eq!(state.device_token.as_deref(), Some("tok-2"));
|
||||
}
|
||||
|
||||
@@ -217,8 +223,11 @@ mod tests {
|
||||
#[test]
|
||||
fn unparseable_cursor_falls_back_to_a_full_sync() {
|
||||
let conn = db();
|
||||
conn.execute("UPDATE sync_state SET last_cursor = 'garbage' WHERE id = 1", [])
|
||||
.expect("bad cursor");
|
||||
conn.execute(
|
||||
"UPDATE sync_state SET last_cursor = 'garbage' WHERE id = 1",
|
||||
[],
|
||||
)
|
||||
.expect("bad cursor");
|
||||
assert_eq!(read(&conn).expect("read").last_cursor, 0);
|
||||
}
|
||||
|
||||
@@ -227,7 +236,10 @@ mod tests {
|
||||
let conn = db();
|
||||
set_link(&conn, "https://a.example.com", "super-secret").expect("link");
|
||||
let json = serde_json::to_string(&status(&conn).expect("status")).expect("serialize");
|
||||
assert!(!json.contains("super-secret"), "token leaked to the webview: {json}");
|
||||
assert!(
|
||||
!json.contains("super-secret"),
|
||||
"token leaked to the webview: {json}"
|
||||
);
|
||||
assert!(json.contains("\"linked\":true"), "got {json}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user