From e1a0b63923c09f3e89500e8a46a5b2d471765753 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 9 Sep 2022 23:21:21 -0700 Subject: [PATCH] termwiz: track size of sgr enum --- termwiz/src/escape/csi.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/termwiz/src/escape/csi.rs b/termwiz/src/escape/csi.rs index 681ebcf77..de4d73db7 100644 --- a/termwiz/src/escape/csi.rs +++ b/termwiz/src/escape/csi.rs @@ -1367,6 +1367,16 @@ pub enum Sgr { Overline(bool), } +#[cfg(all(test, target_pointer_width = "64"))] +#[test] +fn sgr_size() { + assert_eq!(std::mem::size_of::(), 2); + assert_eq!(std::mem::size_of::(), 2); + assert_eq!(std::mem::size_of::(), 20); + assert_eq!(std::mem::size_of::(), 2); + assert_eq!(std::mem::size_of::(), 2); +} + impl Display for Sgr { fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> { macro_rules! code {