Skip to content

Commit

Permalink
Test for output too
Browse files Browse the repository at this point in the history
  • Loading branch information
hadley committed Dec 18, 2024
1 parent ad87924 commit 8009b70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/testthat/helper-provider.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ test_tools_simple <- function(chat_fun) {
chat <- chat_fun(system_prompt = "Be very terse, not even punctuation.")
chat$register_tool(tool(function() "2024-01-01", "Return the current date"))

result <- chat$chat("What's the current date in YMD format?", echo = TRUE)
expect_output(
result <- chat$chat("What's the current date in YMD format?", echo = TRUE),
"2024-01-01"
)
expect_match(result, "2024-01-01")

result <- chat$chat("What month is it? Provide the full name")
Expand Down

0 comments on commit 8009b70

Please sign in to comment.