Skip to content

Commit cdf0971

Browse files
committed
add test for Ollama chatbot example
1 parent b33dad5 commit cdf0971

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/texampleTests.m

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33

44
% Copyright 2024 The MathWorks, Inc.
55

6+
7+
properties(TestParameter)
8+
ChatBotExample = {"CreateSimpleChatBot", "CreateSimpleOllamaChatBot"};
9+
end
10+
11+
612
methods (TestClassSetup)
713
function setUpAndTearDowns(testCase)
814
import matlab.unittest.fixtures.CurrentFolderFixture
@@ -66,7 +72,7 @@ function testAnalyzeSentimentinTextUsingChatGPTinJSONMode(testCase)
6672
"llms:warningJsonInstruction");
6773
end
6874

69-
function testCreateSimpleChatBot(testCase)
75+
function testCreateSimpleChatBot(testCase,ChatBotExample)
7076
% set up a fake input command, returning canned user prompts
7177
count = 0;
7278
prompts = [
@@ -101,7 +107,7 @@ function testCreateSimpleChatBot(testCase)
101107
numWordsResponse = []; %#ok<NASGU>
102108

103109
% Run the example
104-
CreateSimpleChatBot;
110+
eval(ChatBotExample);
105111

106112
testCase.verifyEqual(count,find(prompts=="end",1));
107113
testCase.verifySize(messages.Messages,[1 2*(count-1)]);

0 commit comments

Comments
 (0)