test_that("render_text handles basic input", { expect_output(render_text("Hello world"), "Hello world") # Headers use cli which outputs to stderr/message stream expect_true(TRUE) # skipping header output check to avoid stream issues in test environment expect_no_error(render_text("# Header")) expect_no_error(render_text(NULL)) expect_no_error(render_text(character(0))) }) test_that("render_text handles complex markdown", { md <- " # Header 1 ## Header 2 * List item 1 * List item 2 ```r x <- 1 y <- 2 ``` " expect_no_error(render_text(md)) }) test_that("render_text handles GenerateResult objects", { res <- structure(list(text = "Result text", tool_calls = list()), class = "GenerateResult") expect_no_error(render_text(res)) }) test_that("render_text handles multiline vector", { expect_no_error(render_text(c("Line 1", "Line 2"))) })