images_test.go 350 Bytes
Newer Older
Quinn Slack's avatar
Quinn Slack committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package server

import (
	"testing"

	"github.com/jmorganca/ollama/api"
)

func TestModelPrompt(t *testing.T) {
	var m Model
	req := api.GenerateRequest{
		Template: "a{{ .Prompt }}b",
		Prompt:   "<h1>",
	}
	s, err := m.Prompt(req, "")
	if err != nil {
		t.Fatal(err)
	}
	want := "a<h1>b"
	if s != want {
		t.Errorf("got %q, want %q", s, want)
	}
}