summaryrefslogtreecommitdiff
path: root/pngmeta/metareader_test.go
blob: 51dadc65505f4f9b3a9201dbdc8287fcaf6ad569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package pngmeta

import (
	"fmt"
	"testing"
)

func TestReadMeta(t *testing.T) {
	cases := []struct {
		Filename string
	}{
		{
			Filename: "../sysprompts/default_Seraphina.png",
		},
		{
			Filename: "../sysprompts/llama.png",
		},
	}
	for i, tc := range cases {
		t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) {
			// Call the readMeta function
			pembed, err := extractChar(tc.Filename)
			if err != nil {
				t.Errorf("Expected no error, but got %v", err)
			}
			v, err := pembed.GetDecodedValue()
			if err != nil {
				t.Errorf("Expected no error, but got %v\n", err)
			}
			fmt.Printf("%+v\n", v.Simplify("Adam"))
		})
	}
}