#[test]
fn show_generated_struct() {
use crate::Window;
let _window = Window {
..Default::default()
};
}
#[test]
fn parse1() {
use crate::Window;
use std::str::FromStr;
let window_vec = vec![
#[cfg(feature = "tmux_1_6")]
"1557947146",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_1")]
"0",
#[cfg(all(feature = "tmux_2_1", not(feature = "tmux_2_2")))]
"",
#[cfg(any(
all(feature = "tmux_1_9", not(feature = "tmux_2_2")),
feature = "tmux_2_3"
))]
"",
#[cfg(feature = "tmux_1_9")]
"1",
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(all(feature = "tmux_1_7", not(feature = "tmux_2_6")))]
"",
#[cfg(feature = "tmux_1_6")]
"*",
#[cfg(feature = "tmux_2_6")]
"1",
#[cfg(feature = "tmux_1_6")]
"64",
#[cfg(feature = "tmux_1_7")]
"@0",
#[cfg(feature = "tmux_1_6")]
"4",
#[cfg(feature = "tmux_2_0")]
"0",
#[cfg(feature = "tmux_1_6")]
"3484,177x64,0,0{88x64,0,0,3,88x64,89,0,18}",
#[cfg(feature = "tmux_2_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"0",
#[cfg(feature = "tmux_1_6")]
"bash",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_1_7")]
"2",
#[cfg(feature = "tmux_1_9")]
"0",
#[cfg(feature = "tmux_2_5")]
"0",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_2")]
"3484,177x64,0,0{88x64,0,0,3,88x64,89,0,18}",
#[cfg(feature = "tmux_1_6")]
"177",
#[cfg(feature = "tmux_2_0")]
"0",
];
let window_str = window_vec.join("'");
let window = Window::from_str(&window_str).unwrap();
#[cfg(feature = "tmux_1_7")]
assert_eq!(window.id, Some(0));
}
#[test]
fn parse2() {
use crate::Window;
use std::str::FromStr;
let window_vec = vec![
#[cfg(feature = "tmux_1_6")]
"1557947146",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_1")]
"0",
#[cfg(all(feature = "tmux_2_1", not(feature = "tmux_2_2")))]
"",
#[cfg(any(
all(feature = "tmux_1_9", not(feature = "tmux_2_2")),
feature = "tmux_2_3"
))]
"",
#[cfg(feature = "tmux_1_9")]
"1",
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(all(feature = "tmux_1_7", not(feature = "tmux_2_6")))]
"",
#[cfg(feature = "tmux_1_6")]
"*",
#[cfg(feature = "tmux_2_6")]
"1",
#[cfg(feature = "tmux_1_6")]
"64",
#[cfg(feature = "tmux_1_7")]
"@1",
#[cfg(feature = "tmux_1_6")]
"4",
#[cfg(feature = "tmux_2_0")]
"0",
#[cfg(feature = "tmux_1_6")]
"c3bd,177x64,0,0,0",
#[cfg(feature = "tmux_2_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"0",
#[cfg(feature = "tmux_1_6")]
"bash",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_1_7")]
"2",
#[cfg(feature = "tmux_1_9")]
"0",
#[cfg(feature = "tmux_2_5")]
"0",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_2")]
"c3bd,177x64,0,0,0",
#[cfg(feature = "tmux_1_6")]
"177",
#[cfg(feature = "tmux_2_0")]
"0",
];
let window_str = window_vec.join("'");
let window = Window::from_str(&window_str).unwrap();
#[cfg(feature = "tmux_1_6")]
assert_eq!(window.name, Some("bash".to_string()));
#[cfg(feature = "tmux_1_7")]
assert_eq!(window.id, Some(1));
}
#[test]
fn parse3() {
use crate::Window;
use std::str::FromStr;
let window_vec = vec![
#[cfg(feature = "tmux_1_6")]
"1557947146",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_1")]
"0",
#[cfg(all(feature = "tmux_2_1", not(feature = "tmux_2_2")))]
"",
#[cfg(any(
all(feature = "tmux_1_9", not(feature = "tmux_2_2")),
feature = "tmux_2_3"
))]
"",
#[cfg(feature = "tmux_1_9")]
"1",
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(all(feature = "tmux_1_7", not(feature = "tmux_2_6")))]
"",
#[cfg(feature = "tmux_1_6")]
"",
#[cfg(feature = "tmux_2_6")]
"1",
#[cfg(feature = "tmux_1_6")]
"64",
#[cfg(feature = "tmux_1_7")]
"@2",
#[cfg(feature = "tmux_1_6")]
"4",
#[cfg(feature = "tmux_2_0")]
"0",
#[cfg(feature = "tmux_1_6")]
"c3bd,177x64,0,0,0",
#[cfg(feature = "tmux_2_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"0",
#[cfg(feature = "tmux_1_6")]
"bash",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_1_7")]
"2",
#[cfg(feature = "tmux_1_9")]
"0",
#[cfg(feature = "tmux_2_5")]
"0",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_2")]
"c3bd,177x64,0,0,0",
#[cfg(feature = "tmux_1_6")]
"177",
#[cfg(feature = "tmux_2_0")]
"0",
];
let window_str = window_vec.join("'");
let window = Window::from_str(&window_str).unwrap();
#[cfg(feature = "tmux_1_6")]
assert_eq!(window.name, Some("bash".to_string()));
#[cfg(feature = "tmux_1_7")]
assert_eq!(window.id, Some(2));
}
#[test]
fn parse4() {
use crate::Window;
use std::str::FromStr;
let window_vec = vec![
#[cfg(feature = "tmux_1_6")]
"1557947146",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_1")]
"0",
#[cfg(all(feature = "tmux_2_1", not(feature = "tmux_2_2")))]
"",
#[cfg(any(
all(feature = "tmux_1_9", not(feature = "tmux_2_2")),
feature = "tmux_2_3"
))]
"",
#[cfg(feature = "tmux_1_9")]
"1",
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(all(feature = "tmux_1_7", not(feature = "tmux_2_6")))]
"",
#[cfg(feature = "tmux_1_6")]
"*",
#[cfg(feature = "tmux_2_6")]
"1",
#[cfg(feature = "tmux_1_6")]
"64",
#[cfg(feature = "tmux_1_7")]
"@3",
#[cfg(feature = "tmux_1_6")]
"4",
#[cfg(feature = "tmux_2_0")]
"0",
#[cfg(feature = "tmux_1_6")]
"8b65,177x64,0,0[177x46,0,0,1,177x17,0,47,4]",
#[cfg(feature = "tmux_2_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"0",
#[cfg(feature = "tmux_1_6")]
"bash",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_1_7")]
"2",
#[cfg(feature = "tmux_1_9")]
"0",
#[cfg(feature = "tmux_2_5")]
"0",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_2")]
"8b65,177x64,0,0[177x46,0,0,1,177x17,0,47,4]",
#[cfg(feature = "tmux_1_6")]
"177",
#[cfg(feature = "tmux_2_0")]
"0",
];
let window_str = window_vec.join("'");
let window = Window::from_str(&window_str).unwrap();
#[cfg(feature = "tmux_1_7")]
assert_eq!(window.id, Some(3));
}
#[test]
fn parse5() {
use crate::Window;
use std::str::FromStr;
let window_vec = vec![
#[cfg(feature = "tmux_1_6")]
"1557947146",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_1")]
"0",
#[cfg(all(feature = "tmux_2_1", not(feature = "tmux_2_2")))]
"",
#[cfg(any(
all(feature = "tmux_1_9", not(feature = "tmux_2_2")),
feature = "tmux_2_3"
))]
"",
#[cfg(feature = "tmux_1_9")]
"1",
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(all(feature = "tmux_1_7", not(feature = "tmux_2_6")))]
"",
#[cfg(feature = "tmux_1_6")]
"-",
#[cfg(feature = "tmux_2_6")]
"1",
#[cfg(feature = "tmux_1_6")]
"64",
#[cfg(feature = "tmux_1_7")]
"@4",
#[cfg(feature = "tmux_1_6")]
"4",
#[cfg(feature = "tmux_2_0")]
"0",
#[cfg(feature = "tmux_1_6")]
"7966,177x64,0,0[177x52,0,0,2,177x11,0,53,3]",
#[cfg(feature = "tmux_2_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"0",
#[cfg(feature = "tmux_1_6")]
"bash",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_1_7")]
"2",
#[cfg(feature = "tmux_1_9")]
"0",
#[cfg(feature = "tmux_2_5")]
"0",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_2")]
"7966,177x64,0,0[177x52,0,0,2,177x11,0,53,3]",
#[cfg(feature = "tmux_1_6")]
"177",
#[cfg(feature = "tmux_2_0")]
"0",
];
let window_str = window_vec.join("'");
let window = Window::from_str(&window_str).unwrap();
#[cfg(feature = "tmux_1_7")]
assert_eq!(window.id, Some(4));
}
#[test]
fn parse6() {
use crate::Window;
use std::str::FromStr;
let window_vec = vec![
#[cfg(feature = "tmux_1_6")]
"1557947146",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_1")]
"0",
#[cfg(all(feature = "tmux_2_1", not(feature = "tmux_2_2")))]
"",
#[cfg(any(
all(feature = "tmux_1_9", not(feature = "tmux_2_2")),
feature = "tmux_2_3"
))]
"",
#[cfg(feature = "tmux_1_9")]
"1",
#[cfg(all(feature = "tmux_1_9", not(feature = "tmux_2_0")))]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(all(feature = "tmux_1_7", not(feature = "tmux_2_6")))]
"",
#[cfg(feature = "tmux_1_6")]
"*",
#[cfg(feature = "tmux_2_6")]
"1",
#[cfg(feature = "tmux_1_6")]
"64",
#[cfg(feature = "tmux_1_7")]
"@5",
#[cfg(feature = "tmux_1_6")]
"4",
#[cfg(feature = "tmux_2_0")]
"0",
#[cfg(feature = "tmux_1_6")]
"c3c3,177x64,0,0,6",
#[cfg(feature = "tmux_2_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"",
#[cfg(feature = "tmux_3_1")]
"0",
#[cfg(feature = "tmux_1_6")]
"bash",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_1_7")]
"2",
#[cfg(feature = "tmux_1_9")]
"0",
#[cfg(feature = "tmux_2_5")]
"0",
#[cfg(feature = "tmux_2_9")]
"",
#[cfg(feature = "tmux_2_2")]
"c3c3,177x64,0,0,6",
#[cfg(feature = "tmux_1_6")]
"177",
#[cfg(feature = "tmux_2_0")]
"0",
];
let window_str = window_vec.join("'");
let window = Window::from_str(&window_str).unwrap();
#[cfg(feature = "tmux_1_7")]
assert_eq!(window.id, Some(5));
}