Cotton code
45 lines · 1.5 KB · RustRaw
use super::*;const SLUG: &str = "cotton";const NAME: &str = "Cotton";const ROW: &str = "11111111-2222-4333-8444-555555555555";fn rendered() -> String {    conversation_prompt(SLUG, NAME, ROW)}#[test]fn names_every_verb_it_relies_on() {    let prompt = rendered();    for verb in CONVERSATION_VERBS {        assert!(            prompt.contains(verb),            "the standing prompt no longer names {verb} — either it stopped relying on it (drop \             it from CONVERSATION_VERBS) or the sentence that used it was lost"        );    }}/// THE REASON THE ROW ID IS IN THE PROMPT AT ALL. A tool call carries no/// session identity, so a conversation that could not read its own id could/// not open a thread that hangs off it.#[test]fn tells_the_conversation_its_own_row_id_and_passes_it_as_the_parent() {    let prompt = rendered();    assert!(prompt.contains(ROW), "the conversation is not told which row it is");    assert!(        prompt.contains("parentSessionId"),        "the id is named but never used — a thread opened without it is a standalone"    );    // No placeholder survives the render.    for hole in ["{slug}", "{name}", "{session_id}"] {        assert!(!prompt.contains(hole), "{hole} was never filled");    }}#[test]fn carries_the_project_by_both_its_name_and_its_slug() {    let prompt = conversation_prompt("side-project", "Side Project", ROW);    assert!(prompt.contains("Side Project"), "the name a person says");    assert!(prompt.contains("side-project"), "the slug every verb takes");}