ollama/server/images_test.go

22 lines
290 B
Go
Raw Normal View History

package server
import (
"testing"
)
func TestModelPrompt(t *testing.T) {
2023-12-05 19:57:33 +00:00
m := Model{
Template: "a{{ .Prompt }}b",
}
2023-12-05 19:57:33 +00:00
s, err := m.Prompt(PromptVars{
Prompt: "<h1>",
})
if err != nil {
t.Fatal(err)
}
want := "a<h1>b"
if s != want {
t.Errorf("got %q, want %q", s, want)
}
}