// Module 7 Expansion Drop: ALL. The scenario is in expansion/README.md. use engine::harness::*; #[test] fn test_07x_all_meta_noun() { let mut b = new_baba(LevelDef { width: 4, height: 5, ..Default::default() }); for (word, x) in [("ALL", 0), ("IS", 1), ("YOU", 2)] { b.place(&format!("text:{word}"), x, 0); } let baba = b.place("baba", 0, 4); let rock = b.place("rock", 1, 4); let flag_text = b.place("text:FLAG", 3, 4); assert_eq!(b.active_rules(), vec!["ALL IS YOU", "TEXT IS PUSH"]); assert!(b.has_property(baba, "YOU")); assert!(b.has_property(rock, "YOU")); assert!(!b.has_property(flag_text, "YOU")); for (word, x) in [("BABA", 0), ("IS", 1), ("NOT", 2), ("YOU", 3)] { b.place(&format!("text:{word}"), x, 2); } assert_eq!( b.active_rules(), vec!["ALL IS YOU", "BABA IS NOT YOU", "TEXT IS PUSH"] ); assert!(!b.has_property(baba, "YOU")); assert!(b.has_property(rock, "YOU")); }