docs: M5d-2 checklist: given-test lifetimes and cron AND
session_slot and the scheduler tests held a temporary JSON Value across statements (E0716). Cron now pins DOM and DOW as AND, which the given tests had not. Gate counts from task 04 on move up by one. Co-Authored-By: Grok 4.6 <noreply@x.ai>
This commit is contained in:
@@ -52,6 +52,15 @@ fn the_first_of_the_month() {
|
||||
assert!(!due("0 7 1 * *", "2026-10-02T07:00:00.000Z"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn day_of_month_and_day_of_week_are_both_required() {
|
||||
// 2026-10-04 is a Sunday, not the 1st. 2026-10-01 is a Thursday.
|
||||
assert!(!due("0 7 1 * 0", "2026-10-04T07:00:00.000Z"));
|
||||
assert!(!due("0 7 1 * 0", "2026-10-01T07:00:00.000Z"));
|
||||
// 2026-11-01 is a Sunday and the 1st.
|
||||
assert!(due("0 7 1 * 0", "2026-11-01T07:00:00.000Z"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn four_or_six_fields_are_errors() {
|
||||
assert!(matches!(
|
||||
|
||||
@@ -64,11 +64,8 @@ fn a_due_job_starts_a_new_session_on_the_background_slot() {
|
||||
let sent = server.requests_to(CHAT);
|
||||
assert_eq!(sent.len(), 1);
|
||||
assert_eq!(sent[0].json()["id_slot"], 1);
|
||||
let last = sent[0].json()["messages"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.last()
|
||||
.unwrap();
|
||||
let body = sent[0].json();
|
||||
let last = body["messages"].as_array().unwrap().last().unwrap();
|
||||
let content = last["content"].as_str().unwrap();
|
||||
assert!(
|
||||
content.starts_with("It is 2026-10-03T07:00:00.000Z."),
|
||||
|
||||
@@ -65,11 +65,8 @@ fn a_due_heartbeat_runs_on_the_background_slot_with_a_time_line() {
|
||||
let sent = server.requests_to(CHAT);
|
||||
assert_eq!(sent.len(), 1);
|
||||
assert_eq!(sent[0].json()["id_slot"], 1);
|
||||
let last = sent[0].json()["messages"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.last()
|
||||
.unwrap();
|
||||
let body = sent[0].json();
|
||||
let last = body["messages"].as_array().unwrap().last().unwrap();
|
||||
assert_eq!(last["role"], "user");
|
||||
let content = last["content"].as_str().unwrap();
|
||||
assert!(
|
||||
|
||||
@@ -161,7 +161,7 @@ fn a_heartbeat_turn_between_two_main_turns_does_not_change_the_main_prefix() {
|
||||
assert_eq!(sent[1].json()["id_slot"], 1);
|
||||
assert_eq!(sent[2].json()["id_slot"], 0);
|
||||
let first = sent[0].json()["messages"].as_array().unwrap().clone();
|
||||
let third = sent[2].json()["messages"].as_array().unwrap();
|
||||
let third = sent[2].json()["messages"].as_array().unwrap().clone();
|
||||
assert!(
|
||||
third.len() > first.len(),
|
||||
"the main session's second turn is a longer prefix"
|
||||
|
||||
Reference in New Issue
Block a user