AGPL-3.0-only, a source link in the app, and everything on dev since #5 #6
@@ -392,13 +392,20 @@ mod tests {
|
||||
// must not break the handshake.
|
||||
// Versions come from the constants, not literals: this test is about unknown
|
||||
// FIELDS, and pinning the numbers made it fail the moment the protocol moved
|
||||
// to v2 — for a reason that has nothing to do with what it checks.
|
||||
// to v2 — for a reason that has nothing to do with what it checks. The feature
|
||||
// list likewise: a literal one went stale when `attachment_sync` was added.
|
||||
let features: Vec<&str> = REQUIRED_FEATURES
|
||||
.iter()
|
||||
.chain(OPTIONAL_FEATURES.iter())
|
||||
.copied()
|
||||
.collect();
|
||||
let body = format!(
|
||||
r#"{{"site_name":"S","sync_protocol_version":{v},
|
||||
"min_client_protocol_version":{v},
|
||||
"sync_features":["notes","labels","attachments","tombstones","revisions"],
|
||||
"sync_features":{f},
|
||||
"some_future_field":{{"nested":true}}}}"#,
|
||||
v = CLIENT_PROTOCOL_VERSION,
|
||||
f = serde_json::to_string(&features).expect("features"),
|
||||
);
|
||||
let info: ServerInfo = serde_json::from_str(&body).expect("unknown fields are ignored");
|
||||
assert_eq!(evaluate(&info), Compatibility::Ok);
|
||||
|
||||
Reference in New Issue
Block a user