1
0
Fork 0

Add pretty_assertions to tests

gh-action
Bo Jeanes 2022-08-27 06:12:50 +10:00
parent c300575dc8
commit 3e926e2b0b
4 changed files with 45 additions and 1 deletions

38
Cargo.lock generated
View File

@ -156,6 +156,22 @@ dependencies = [
"os_str_bytes", "os_str_bytes",
] ]
[[package]]
name = "ctor"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "diff"
version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
[[package]] [[package]]
name = "either" name = "either"
version = "1.7.0" version = "1.7.0"
@ -509,6 +525,7 @@ dependencies = [
"clap", "clap",
"humantime-serde", "humantime-serde",
"itertools", "itertools",
"pretty_assertions",
"rumqttc", "rumqttc",
"rust_decimal", "rust_decimal",
"serde", "serde",
@ -585,6 +602,15 @@ version = "6.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa"
[[package]]
name = "output_vt100"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66"
dependencies = [
"winapi",
]
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.1.0" version = "2.1.0"
@ -635,6 +661,18 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7"
[[package]]
name = "pretty_assertions"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c89f989ac94207d048d92db058e4f6ec7342b0971fc58d1271ca148b799b3563"
dependencies = [
"ansi_term",
"ctor",
"diff",
"output_vt100",
]
[[package]] [[package]]
name = "proc-macro-error" name = "proc-macro-error"
version = "1.0.4" version = "1.0.4"

View File

@ -20,3 +20,6 @@ tokio-modbus = "0.5.3"
tokio-serial = "5.4.3" tokio-serial = "5.4.3"
tracing = "0.1.36" tracing = "0.1.36"
tracing-subscriber = "0.3.15" tracing-subscriber = "0.3.15"
[dev-dependencies]
pretty_assertions = "1.2.1"

View File

@ -1,6 +1,8 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::time::Duration; use std::time::Duration;
#[cfg(test)]
use pretty_assertions::{assert_eq, assert_ne};
#[cfg(test)] #[cfg(test)]
use serde_json::json; use serde_json::json;

View File

@ -123,7 +123,8 @@ impl Register {
} }
} }
} }
#[cfg(test)]
use pretty_assertions::{assert_eq, assert_ne};
#[test] #[test]
fn test_parse_1() { fn test_parse_1() {
use self::config::{RegisterParse, Swap}; use self::config::{RegisterParse, Swap};