feat: add new assertions test type

This commit is contained in:
technofab 2026-10-15 19:27:05 +02:00
parent 6c4c1bace6
commit 17d08b9975
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
10 changed files with 603 additions and 16 deletions

View file

@ -5,25 +5,35 @@ import "time"
type TestType string
const (
TestTypeScript TestType = "script"
TestTypeUnit TestType = "unit"
TestTypeSnapshot TestType = "snapshot"
TestTypeScript TestType = "script"
TestTypeUnit TestType = "unit"
TestTypeSnapshot TestType = "snapshot"
TestTypeAssertions TestType = "assertions"
)
type AssertionResult struct {
Ok bool `json:"ok"`
Error bool `json:"error,omitempty"`
Message string `json:"message,omitempty"`
Expected string `json:"expected,omitempty"`
Actual string `json:"actual,omitempty"`
}
type SuiteSpec struct {
Name string `json:"name"`
Tests []TestSpec `json:"tests"`
}
type TestSpec struct {
Type TestType `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Expected any `json:"expected,omitempty"`
Actual any `json:"actual,omitempty"`
ActualDrv string `json:"actualDrv,omitempty"`
Script string `json:"script,omitempty"`
Pos string `json:"pos,omitempty"`
Type TestType `json:"type"`
Name string `json:"name"`
Description string `json:"description"`
Expected any `json:"expected,omitempty"`
Actual any `json:"actual,omitempty"`
ActualDrv string `json:"actualDrv,omitempty"`
Script string `json:"script,omitempty"`
Assertions map[string]AssertionResult `json:"assertions,omitempty"`
Pos string `json:"pos,omitempty"`
Suite string
}