Skip to content

Commit

Permalink
test(parse): add test case for valid chat input
Browse files Browse the repository at this point in the history
This commit adds a new test case to ensure the `TestParseChatFile` function correctly handles a valid chat input scenario. The test verifies that the input is parsed into the expected chat completion request message without errors.
  • Loading branch information
yiblet committed Dec 3, 2024
1 parent c89dc35 commit d023e4a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions parse/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ func TestParseChatFile(t *testing.T) {
},
err: false,
},
{
name: "Valid chat",
input: "--- user\nUser message\n",
expected: []gpt3.ChatCompletionRequestMessage{
{Role: "user", Content: "User message\n"},
},
err: false,
},
{
name: "Empty input",
input: "",
Expand Down

0 comments on commit d023e4a

Please sign in to comment.