Uses serde_jsons preserve order for tests that depend on map order
This commit is contained in:
Родитель
3ca067683c
Коммит
2b3635e05a
|
@ -1205,9 +1205,6 @@ fn test_evolver_feature_can_have_only_one_experiment() -> Result<()> {
|
|||
json!({ "text": "OK then", "number": 42})
|
||||
);
|
||||
|
||||
let string = serde_json::to_string(&enrolled_feature.feature.value).unwrap();
|
||||
assert_eq!(string, "{\"number\":42,\"text\":\"OK then\"}");
|
||||
|
||||
// Now let's keep the same number of experiments.
|
||||
// We should get the same results as before.
|
||||
// This time we're testing with a non-empty starting condition.
|
||||
|
|
|
@ -26,3 +26,6 @@ uniffi = { workspace = true, features = ["build"] }
|
|||
expect-test = "1.4"
|
||||
viaduct-reqwest = { path = "../support/viaduct-reqwest" }
|
||||
mockito = "0.31"
|
||||
# We add the perserve_order feature to guarantee ordering of the keys in our
|
||||
# JSON objects as they get serialized/deserialized.
|
||||
serde_json = { version = "1", features = ["preserve_order"] }
|
||||
|
|
|
@ -777,15 +777,15 @@ mod test {
|
|||
},
|
||||
),
|
||||
fields: {
|
||||
"title": String(
|
||||
"jpg-attachment",
|
||||
),
|
||||
"content": String(
|
||||
"content",
|
||||
),
|
||||
"schema": Number(
|
||||
1677694447771,
|
||||
),
|
||||
"title": String(
|
||||
"jpg-attachment",
|
||||
),
|
||||
},
|
||||
},
|
||||
RemoteSettingsRecord {
|
||||
|
@ -802,15 +802,15 @@ mod test {
|
|||
},
|
||||
),
|
||||
fields: {
|
||||
"title": String(
|
||||
"with-attachment",
|
||||
),
|
||||
"content": String(
|
||||
"content",
|
||||
),
|
||||
"schema": Number(
|
||||
1677694447771,
|
||||
),
|
||||
"title": String(
|
||||
"with-attachment",
|
||||
),
|
||||
},
|
||||
},
|
||||
RemoteSettingsRecord {
|
||||
|
@ -819,15 +819,15 @@ mod test {
|
|||
deleted: false,
|
||||
attachment: None,
|
||||
fields: {
|
||||
"title": String(
|
||||
"no-attachment",
|
||||
),
|
||||
"content": String(
|
||||
"content",
|
||||
),
|
||||
"schema": Number(
|
||||
1677694447771,
|
||||
),
|
||||
"title": String(
|
||||
"no-attachment",
|
||||
),
|
||||
},
|
||||
},
|
||||
RemoteSettingsRecord {
|
||||
|
@ -928,15 +928,15 @@ mod test {
|
|||
},
|
||||
),
|
||||
fields: {
|
||||
"title": String(
|
||||
"jpg-attachment",
|
||||
),
|
||||
"content": String(
|
||||
"content",
|
||||
),
|
||||
"schema": Number(
|
||||
1677694447771,
|
||||
),
|
||||
"title": String(
|
||||
"jpg-attachment",
|
||||
),
|
||||
},
|
||||
},
|
||||
RemoteSettingsRecord {
|
||||
|
@ -953,15 +953,15 @@ mod test {
|
|||
},
|
||||
),
|
||||
fields: {
|
||||
"title": String(
|
||||
"with-attachment",
|
||||
),
|
||||
"content": String(
|
||||
"content",
|
||||
),
|
||||
"schema": Number(
|
||||
1677694447771,
|
||||
),
|
||||
"title": String(
|
||||
"with-attachment",
|
||||
),
|
||||
},
|
||||
},
|
||||
RemoteSettingsRecord {
|
||||
|
@ -970,15 +970,15 @@ mod test {
|
|||
deleted: false,
|
||||
attachment: None,
|
||||
fields: {
|
||||
"title": String(
|
||||
"no-attachment",
|
||||
),
|
||||
"content": String(
|
||||
"content",
|
||||
),
|
||||
"schema": Number(
|
||||
1677694447771,
|
||||
),
|
||||
"title": String(
|
||||
"no-attachment",
|
||||
),
|
||||
},
|
||||
},
|
||||
RemoteSettingsRecord {
|
||||
|
|
|
@ -36,6 +36,9 @@ tempfile = "3"
|
|||
# on its behalf.
|
||||
libsqlite3-sys = { workspace = true }
|
||||
sql-support = { path = "../support/sql" }
|
||||
# We add the perserve_order feature to guarantee ordering of the keys in our
|
||||
# JSON objects as they get serialized/deserialized.
|
||||
serde_json = { version = "1", features = ["preserve_order"] }
|
||||
|
||||
[build-dependencies]
|
||||
nss_build_common = { path = "../support/rc_crypto/nss/nss_build_common" }
|
||||
|
|
|
@ -516,8 +516,8 @@ mod tests {
|
|||
assert_eq!(
|
||||
clear(&tx, ext_id)?,
|
||||
make_changes(&[
|
||||
("foo", Some(json!({"sub-object": "sub-value"})), None),
|
||||
("other", Some(json!("also new")), None),
|
||||
("foo", Some(json!({"sub-object": "sub-value"})), None),
|
||||
]),
|
||||
);
|
||||
assert_eq!(get(&tx, ext_id, JsonValue::Null)?, json!({}));
|
||||
|
|
|
@ -378,7 +378,7 @@ fn test_merged_incoming() -> Result<()> {
|
|||
check_finished_with(
|
||||
&tx,
|
||||
"ext-id",
|
||||
json!({"key1": "key1-new", "key2": "key2-incoming"}),
|
||||
json!({"key2": "key2-incoming", "key1": "key1-new"}),
|
||||
)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче