From d552c67f027d31930ca5dfde7f3c13d7eea22670 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Thu, 18 Jan 2024 04:54:09 -0800 Subject: [PATCH] googleai: fix test comparisons to use case-insensitive regexps (#528) --- llms/googleai/googleai_llm_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llms/googleai/googleai_llm_test.go b/llms/googleai/googleai_llm_test.go index 2c4739bce..e1fc53b55 100644 --- a/llms/googleai/googleai_llm_test.go +++ b/llms/googleai/googleai_llm_test.go @@ -77,12 +77,12 @@ func TestMultiContentTextStream(t *testing.T) { assert.NotEmpty(t, rsp.Choices) // Check that the combined response contains what we expect c1 := rsp.Choices[0] - assert.Regexp(t, "dog|canid|canine", strings.ToLower(c1.Content)) + assert.Regexp(t, "(?i)dog|canid|canine", c1.Content) // Check that multiple chunks were received and they also have words // we expect. assert.GreaterOrEqual(t, len(chunks), 2) - assert.Regexp(t, "dog|canid|canine", sb.String()) + assert.Regexp(t, "(?i)dog|canid|canine", sb.String()) } func TestMultiContentTextChatSequence(t *testing.T) {