//! End-to-end test for `#[klieo_macros::test]`.

use klieo_core::test_utils::{FakeLlmStep, TestContext};

#[klieo_macros::test]
async fn attribute_macro_async_with_context_compiles_and_runs(ctx: TestContext) {
    let mut ctx = ctx
        .with_canned_llm_responses(vec![FakeLlmStep::Text("ok".into())])
        .with_system_prompt("you are a test");
    let out = ctx.run_steps_directly().await.expect("run completes");
    assert_eq!(out, "ok");
}

#[klieo_macros::test]
async fn attribute_macro_async_no_context_compiles_and_runs() {
    // Plain async body, no TestContext arg — macro should still produce
    // a synchronous #[test] fn that block_on()s the body.
    let v = async { 1 + 1 }.await;
    assert_eq!(v, 2);
}
