diff --git a/crates/mind-body/src/projection/interpret/tests.rs b/crates/mind-body/src/projection/interpret/tests.rs index 00b176d..23d8194 100644 --- a/crates/mind-body/src/projection/interpret/tests.rs +++ b/crates/mind-body/src/projection/interpret/tests.rs @@ -419,23 +419,23 @@ fn pass_on_packet() -> Packet { /// still refuses a draft that is the quoted words. #[test] fn k20_a_line_replies_only_to_a_listed_line_and_the_echo_check_still_holds() { - let packet = pass_on_packet(); - assert_eq!(packet.quotable.iter().map(|line| (line.id.as_str(), line.event.as_str())).collect::>(), [("q1", "$m1"), ("q2", "$k1")], "earlier lines first, then the new"); - let prompt = speech_prompt(&packet, "x", "y", &Tuning::default()); + let passing = pass_on_packet(); + assert_eq!(passing.quotable.iter().map(|line| (line.id.as_str(), line.event.as_str())).collect::>(), [("q1", "$m1"), ("q2", "$k1")], "earlier lines first, then the new"); + let prompt = speech_prompt(&passing, "x", "y", &Tuning::default()); assert!(prompt.contains("Lines in this room he may reply to, as id \u{2014} who: line:\n- q1 \u{2014} Meta (@meta:gamecult.org): \"Nobody touches the release branch until I'm back. I mean it, all of you.\"\n- q2 \u{2014} Kiko (@kiko:gamecult.org): "), "{prompt}"); assert!(!prompt.contains("$m1") && !prompt.contains("$k1"), "the actuator's handle is never shown to a model"); assert!(prompt.contains("(`in_reply_to`, or null: the room shows that line, with who said it, above his own words)"), "{prompt}"); let prose = "This is what she said before she left."; - let said = decided_in(&packet, prose, json!([{ "draft": 1, "in_reply_to": "q1" }])); + let said = decided_in(&passing, prose, json!([{ "draft": 1, "in_reply_to": "q1" }])); assert_eq!(said["said"][0]["in_reply_to"], json!({ "id": "q1", "event": "$m1", "who": "Meta (@meta:gamecult.org)", "text": "Nobody touches the release branch until I'm back. I mean it, all of you." }), "{said}"); assert_eq!(said["said"][0]["text"], "This is what she said before she left.", "his own words, and nothing code wrote"); for off in ["q9", "$m1"] { - let refused = answered(&packet, prose, json!({ "say": [{ "draft": 1, "in_reply_to": off }], "gaps": [], "suggest": [{ "kind": "idea", "draft": 1, "about": null, "private": false }] })); + let refused = answered(&passing, prose, json!({ "say": [{ "draft": 1, "in_reply_to": off }], "gaps": [], "suggest": [{ "kind": "idea", "draft": 1, "about": null, "private": false }] })); assert_eq!((texts(&refused), refused["refused"][0]["reason"].as_str()), (vec![], Some("not_quotable")), "{off}: {refused}"); assert_eq!(refused["suggestions"][0]["draft"], 1, "a refused line leaves its draft free: {refused}"); } assert_eq!(decided_in(&pass_on_packet(), prose, json!([{ "draft": 1, "in_reply_to": null }]))["said"][0]["in_reply_to"], Value::Null); - let echo = decided_in(&packet, "Nobody touches the release branch until I'm back. I mean it, all of you.", json!([{ "draft": 1, "in_reply_to": "q1" }])); + let echo = decided_in(&passing, "Nobody touches the release branch until I'm back. I mean it, all of you.", json!([{ "draft": 1, "in_reply_to": "q1" }])); assert!(texts(&echo).is_empty() && refused_why(&echo).contains("echo"), "a reply does not skip the echo check: {echo}"); assert!(speech_prompt(&packet(), "x", "y", &Tuning::default()).contains("may reply to, as id \u{2014} who: line:\n- none\n"), "lines without an event are not listed"); }