@@ -2,16 +2,16 @@ local h = require("tests.helpers")
22local adapter
33
44local new_set = MiniTest .new_set
5- T = new_set ({
5+ T = new_set ()
6+
7+ T [" DeepSeek adapter" ] = new_set ({
68 hooks = {
79 pre_case = function ()
810 adapter = require (" codecompanion.adapters" ).resolve (" deepseek" )
911 end ,
1012 },
1113})
1214
13- T [" DeepSeek adapter" ] = new_set ()
14-
1515T [" DeepSeek adapter" ][" it can form messages to be sent to the API" ] = function ()
1616 local messages = { {
1717 content = " Explain Ruby in two words" ,
@@ -97,19 +97,18 @@ T["DeepSeek adapter"]["No Streaming"] = new_set({
9797})
9898
9999T [" DeepSeek adapter" ][" No Streaming" ][" can output for the chat buffer" ] = function ()
100- local lines = vim .fn .readfile (" tests/adapters/stubs/deepseek_no_streaming.txt" )
101- lines = table.concat (lines , " \n " )
100+ local data = vim .fn .readfile (" tests/adapters/stubs/deepseek_no_streaming.txt" )
101+ data = table.concat (data , " \n " )
102102
103- h .eq (" Elegant simplicity." , adapter .handlers .chat_output (adapter , lines ).output .content )
103+ h .eq (" Elegant simplicity." , adapter .handlers .chat_output (adapter , data ).output .content )
104104end
105105
106106T [" DeepSeek adapter" ][" No Streaming" ][" can output for the inline assistant" ] = function ()
107107 local data = vim .fn .readfile (" tests/adapters/stubs/deepseek_no_streaming.txt" )
108108 data = table.concat (data , " \n " )
109109
110- local json = {
111- body = data ,
112- }
110+ -- JSON object needs the body key
111+ local json = { body = data }
113112
114113 h .eq (" Elegant simplicity." , adapter .handlers .inline_output (adapter , json ).output )
115114end
0 commit comments