CfgPath: Test serialisation round-trip with a binary format
Use MessagePack. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
This commit is contained in:
parent
1e6c6169a8
commit
2da84857a5
|
@ -2162,6 +2162,12 @@ dependencies = [
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "paste"
|
||||||
|
version = "1.0.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pathdiff"
|
name = "pathdiff"
|
||||||
version = "0.2.1"
|
version = "0.2.1"
|
||||||
|
@ -2536,6 +2542,28 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rmp"
|
||||||
|
version = "0.8.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f"
|
||||||
|
dependencies = [
|
||||||
|
"byteorder",
|
||||||
|
"num-traits",
|
||||||
|
"paste",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rmp-serde"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "25786b0d276110195fa3d6f3f31299900cf71dfbd6c28450f3f58a0e7f7a347e"
|
||||||
|
dependencies = [
|
||||||
|
"byteorder",
|
||||||
|
"rmp",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rsa"
|
name = "rsa"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
|
@ -3296,6 +3324,7 @@ dependencies = [
|
||||||
"directories",
|
"directories",
|
||||||
"dirs",
|
"dirs",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
"rmp-serde",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"shellexpand-fork",
|
"shellexpand-fork",
|
||||||
|
|
|
@ -30,6 +30,7 @@ directories = { version = "4", optional = true }
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
config = { version = "0.12.0", default-features = false, features = ["toml"] }
|
config = { version = "0.12.0", default-features = false, features = ["toml"] }
|
||||||
dirs = "4.0.0"
|
dirs = "4.0.0"
|
||||||
|
rmp-serde = "1"
|
||||||
serde_json = "1.0.50"
|
serde_json = "1.0.50"
|
||||||
toml = "0.5"
|
toml = "0.5"
|
||||||
tracing-test = "0.2"
|
tracing-test = "0.2"
|
||||||
|
|
|
@ -420,4 +420,12 @@ mod test_serde {
|
||||||
fn roundtrip_toml() {
|
fn roundtrip_toml() {
|
||||||
test_roundtrip_cases(|input| toml::to_string(&input), |toml| toml::from_str(toml));
|
test_roundtrip_cases(|input| toml::to_string(&input), |toml| toml::from_str(toml));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn roundtrip_mpack() {
|
||||||
|
test_roundtrip_cases(
|
||||||
|
|input| rmp_serde::to_vec(&input),
|
||||||
|
|mpack| rmp_serde::from_slice(mpack),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue