interpreter sees acts: the swap test tells old from fresh by status (wakes in the test share a key)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cffc08efee
commit
1b1ad4730b
1 changed files with 3 additions and 3 deletions
|
|
@ -381,9 +381,9 @@ fn a_drop_frees_its_words_and_a_ready_re_add_readies_the_open_intention() {
|
|||
let old = intentions(&first).last().unwrap().clone();
|
||||
let (swapped, applied) = run(&first, json!({ "intend": { "drop": [old["id"]], "add": [{ "summary": words, "expires_in_hours": 24 }] } }));
|
||||
let after = intentions(&swapped);
|
||||
let (retired, fresh) = (after.iter().find(|action| action["id"] == old["id"]).unwrap(), after.last().unwrap());
|
||||
assert_eq!((retired["status"].as_str(), fresh["status"].as_str(), fresh["summary"].as_str(), reasons(&applied)), (Some("retired"), Some("active"), Some(words), vec![]));
|
||||
assert_ne!(fresh["id"], old["id"]);
|
||||
// (Both wakes here share one key, so the fresh intention's id repeats the old one's: told apart by status.)
|
||||
let states = after.iter().filter(|action| action["summary"] == words).map(|action| action["status"].as_str().unwrap().to_owned()).collect::<Vec<_>>();
|
||||
assert_eq!((states, reasons(&applied)), (vec!["retired".to_owned(), "active".to_owned()], vec![]));
|
||||
|
||||
assert_eq!(old["readiness"], "waiting");
|
||||
let (readied, applied) = run(&first, json!({ "intend": { "add": [{ "summary": words.to_uppercase(), "expires_in_hours": 24, "readiness": "ready" }] } }));
|
||||
|
|
|
|||
Loading…
Reference in a new issue