diff options
Diffstat (limited to 'internal/testutil')
| -rw-r--r-- | internal/testutil/fixtures_test.go | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/internal/testutil/fixtures_test.go b/internal/testutil/fixtures_test.go index 7c7f239..4f6b365 100644 --- a/internal/testutil/fixtures_test.go +++ b/internal/testutil/fixtures_test.go @@ -1,6 +1,9 @@ package testutil -import "testing" +import ( + "strings" + "testing" +) func TestFixtures_ZeroCovTargets(t *testing.T) { if MarkdownCodeFence() == "" { @@ -10,3 +13,39 @@ func TestFixtures_ZeroCovTargets(t *testing.T) { t.Fatal("MalformedJSON empty") } } + +func TestMultilineDocBlock(t *testing.T) { + got := MultilineDocBlock() + if !strings.Contains(got, "\n") { + t.Fatal("expected multi-line string") + } + if !strings.HasPrefix(got, "//") { + t.Fatal("expected comment prefix") + } + if !strings.Contains(got, "sum") { + t.Fatal("expected documentation about sum") + } +} + +func TestMultilineChatReply(t *testing.T) { + got := MultilineChatReply() + if !strings.Contains(got, "\n") { + t.Fatal("expected multi-line string") + } + if !strings.Contains(got, "Hello") { + t.Fatal("expected greeting in reply") + } +} + +func TestMultilineFunctionSuggestion(t *testing.T) { + got := MultilineFunctionSuggestion() + if !strings.Contains(got, "\n") { + t.Fatal("expected multi-line string") + } + if !strings.Contains(got, "context.Context") { + t.Fatal("expected context parameter") + } + if !strings.Contains(got, "return") { + t.Fatal("expected return statement") + } +} |
