aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2024-06-11 09:10:46 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2024-06-17 09:02:22 +0300
commitfee72b87cf732180889ebc9151b77249533d6995 (patch)
tree45542aebb228a6c5121dbf5d1044bae763d2572e
parent6c47bd6e80500c66273a5c14993343d70efe6c39 (diff)
downloadniri-fee72b87cf732180889ebc9151b77249533d6995.tar.gz
niri-fee72b87cf732180889ebc9151b77249533d6995.tar.bz2
niri-fee72b87cf732180889ebc9151b77249533d6995.zip
niri-config: Add pretty-assertions to tests
The config parse test is pretty big and it's impossible to tell the difference from the normal assert.
-rw-r--r--Cargo.lock17
-rw-r--r--niri-config/Cargo.toml3
-rw-r--r--niri-config/src/lib.rs2
3 files changed, 22 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fbab1723..03c777fe 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2216,6 +2216,7 @@ dependencies = [
"knuffel",
"miette",
"niri-ipc",
+ "pretty_assertions",
"regex",
"smithay",
"tracing",
@@ -2683,6 +2684,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
[[package]]
+name = "pretty_assertions"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66"
+dependencies = [
+ "diff",
+ "yansi",
+]
+
+[[package]]
name = "proc-macro-crate"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4376,6 +4387,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d422e8e38ec76e2f06ee439ccc765e9c6a9638b9e7c9f2e8255e4d41e8bd852"
[[package]]
+name = "yansi"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
+
+[[package]]
name = "yansi-term"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/niri-config/Cargo.toml b/niri-config/Cargo.toml
index 89b3acb5..f0067c15 100644
--- a/niri-config/Cargo.toml
+++ b/niri-config/Cargo.toml
@@ -17,3 +17,6 @@ regex = "1.10.5"
smithay = { workspace = true, features = ["backend_libinput"] }
tracing.workspace = true
tracy-client.workspace = true
+
+[dev-dependencies]
+pretty_assertions = "1.4.0"
diff --git a/niri-config/src/lib.rs b/niri-config/src/lib.rs
index cbf70e59..4fbb96e1 100644
--- a/niri-config/src/lib.rs
+++ b/niri-config/src/lib.rs
@@ -2320,6 +2320,8 @@ pub fn set_miette_hook() -> Result<(), miette::InstallError> {
#[cfg(test)]
mod tests {
+ use pretty_assertions::assert_eq;
+
use super::*;
#[track_caller]