Update json literal formatting
This commit is contained in:
parent
8e4ff82a83
commit
f23d7414ec
@ -453,10 +453,11 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn deserialization_structure_mismatch() {
|
fn deserialization_structure_mismatch() {
|
||||||
// Missing several required fields.
|
// Missing several required fields.
|
||||||
let error = from_json_value::<EventJson<StartEventContent>>(json!({"from_device": "123"}))
|
let error =
|
||||||
.unwrap()
|
from_json_value::<EventJson<StartEventContent>>(json!({ "from_device": "123" }))
|
||||||
.deserialize()
|
.unwrap()
|
||||||
.unwrap_err();
|
.deserialize()
|
||||||
|
.unwrap_err();
|
||||||
|
|
||||||
assert!(error.message().contains("missing field"));
|
assert!(error.message().contains("missing field"));
|
||||||
assert!(error.is_deserialization());
|
assert!(error.is_deserialization());
|
||||||
|
@ -487,7 +487,7 @@ mod tests {
|
|||||||
fn serialize_contains_display_name_condition() {
|
fn serialize_contains_display_name_condition() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
to_json_value(&PushCondition::ContainsDisplayName).unwrap(),
|
to_json_value(&PushCondition::ContainsDisplayName).unwrap(),
|
||||||
json!({"kind": "contains_display_name"})
|
json!({ "kind": "contains_display_name" })
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn deserialize_contains_display_name_condition() {
|
fn deserialize_contains_display_name_condition() {
|
||||||
assert_matches!(
|
assert_matches!(
|
||||||
from_json_value::<PushCondition>(json!({"kind": "contains_display_name"})).unwrap(),
|
from_json_value::<PushCondition>(json!({ "kind": "contains_display_name" })).unwrap(),
|
||||||
PushCondition::ContainsDisplayName
|
PushCondition::ContainsDisplayName
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -329,7 +329,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn deserialization_failure() {
|
fn deserialization_failure() {
|
||||||
assert!(from_json_value::<EventJson<EncryptedEventContent>>(
|
assert!(from_json_value::<EventJson<EncryptedEventContent>>(
|
||||||
json!({"algorithm": "m.megolm.v1.aes-sha2"})
|
json!({ "algorithm": "m.megolm.v1.aes-sha2" })
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.deserialize()
|
.deserialize()
|
||||||
|
@ -222,7 +222,7 @@ mod tests {
|
|||||||
},
|
},
|
||||||
"event_id": "$h29iv0s8:example.com",
|
"event_id": "$h29iv0s8:example.com",
|
||||||
"origin_server_ts": 1,
|
"origin_server_ts": 1,
|
||||||
"prev_content": {"name": "The old name"},
|
"prev_content": { "name": "The old name" },
|
||||||
"room_id": "!n8f893n9:example.com",
|
"room_id": "!n8f893n9:example.com",
|
||||||
"sender": "@carl:example.com",
|
"sender": "@carl:example.com",
|
||||||
"state_key": "",
|
"state_key": "",
|
||||||
|
@ -351,7 +351,7 @@ mod tests {
|
|||||||
"type": "m.room.name",
|
"type": "m.room.name",
|
||||||
"state_key": "",
|
"state_key": "",
|
||||||
"sender": "@example:localhost",
|
"sender": "@example:localhost",
|
||||||
"content": {"name": "Ruma"}
|
"content": { "name": "Ruma" }
|
||||||
});
|
});
|
||||||
|
|
||||||
let join_rules_event = json!({
|
let join_rules_event = json!({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user