use crate::cnf::CnfFormula;
use crate::dot::*;
use crate::tests::common::clause_dimacs;
use crate::tests::dot_fixture::node_line;
use crate::vtree::Vtree;
use crate::vtree::VtreeIdx;
#[test]
fn a_flat_load_renders_calm_not_maximally_hot() {
let formula = CnfFormula {
num_vars: 4,
clauses: vec![clause_dimacs(&[1, 2]), clause_dimacs(&[3, 4])],
};
let vtree = Vtree::balanced(4);
let ann = annotate_from_cnf(&vtree, &formula, None);
assert_eq!(ann.heat(VtreeIdx(4)), Some(FLAT_LOAD_HEAT));
assert_eq!(ann.heat(VtreeIdx(5)), Some(FLAT_LOAD_HEAT));
assert_eq!(
ann.heat(VtreeIdx(6)),
Some(0.0),
"the unloaded root stays at the bottom"
);
let dot = vtree_to_dot(&vtree, Some(&ann));
assert!(
!node_line(&dot, 4).contains("#800026"),
"a uniform tree must not render at the alarm end of the scale",
);
}