use super::*;
#[test]
fn a_stamps_off_flag_is_absent_from_the_wire_until_set() {
let plain = ProcessInfo::builder(1, "web", ProcStatus::Online).build();
let json = serde_json::to_string(&plain).expect("serialize");
assert!(
!json.contains("log_timestamps"),
"a row with nothing to say carries no key at all: {json}"
);
let unstamped = ProcessInfo::builder(1, "web", ProcStatus::Online)
.log_timestamps(Some(false))
.build();
let json = serde_json::to_string(&unstamped).expect("serialize");
assert!(json.contains(r#""log_timestamps":false"#), "{json}");
let back: ProcessInfo = serde_json::from_str(&json).expect("round trip");
assert_eq!(back.log_timestamps, Some(false));
}