Skip to content

Commit

Permalink
test: add new references test
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Jan 8, 2025
1 parent b490b9e commit 9895a4b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/strategies/chat/test_references.lua
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,22 @@ T["References"]["Render"] = function()
h.eq(h.get_buf_lines(chat.bufnr), { "## foo", "", "> Sharing:", "> -  <buf>pinned example</buf>", "", "" })
end

T["References"]["can be cleared from messages"] = function()
chat.References:add({
id = "<buf>pinned example</buf>",
path = "tests.stubs.file.txt",
source = "tests.strategies.chat.slash_commands.basic",
opts = {
pinned = true,
},
})

local message = {
role = "user",
content = "> Sharing:\n> -  <buf>pinned example</buf>\n\nHello, World",
}

h.eq("Hello, World", chat.References:clear(message).content)
end

return T

0 comments on commit 9895a4b

Please sign in to comment.