Move embedded prompts to PromptKit definitions
This commit is contained in:
@@ -5,9 +5,31 @@ import (
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPromptKitSchemaPathsUseCanonicalAssets(t *testing.T) {
|
||||
for _, key := range []Key{CorrectionSetKey, ValidatorDecisionSetKey} {
|
||||
path, ok := AssetPath(key)
|
||||
if !ok {
|
||||
t.Fatalf("missing path for %q", key)
|
||||
}
|
||||
file, err := Filesystem().Open(AssetRoot + "/" + path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
data, err := io.ReadAll(file)
|
||||
file.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !bytes.Equal(data, MustLookup(key).JSONSchema) {
|
||||
t.Fatalf("PromptKit schema differs for %q", key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const (
|
||||
expectedCorrectionSetSHA256 = "b86a2dde38d7f440d26470fa8830167512bb0aa1b35e5fee5547057be583c388"
|
||||
expectedValidatorDecisionSetSHA256 = "2fe90d450e2595b57885aba91c8cc5cedf783dd36758ab430309e3eace401f54"
|
||||
|
||||
Reference in New Issue
Block a user