31 lines
977 B
Go
31 lines
977 B
Go
package metadata
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"gitea.maximumdirect.net/eric/audita/internal/framework/contracts"
|
|
frameworkvalidators "gitea.maximumdirect.net/eric/audita/internal/framework/validators"
|
|
)
|
|
|
|
type unclassifiedValidator struct{}
|
|
|
|
func (u unclassifiedValidator) Name() string { return "unclassified" }
|
|
|
|
func (u unclassifiedValidator) Validate(_ context.Context, _ contracts.ValidationRequest) (frameworkvalidators.Result, error) {
|
|
return frameworkvalidators.Result{ValidatorName: u.Name(), Decisions: nil}, nil
|
|
}
|
|
|
|
func TestClassOfDefaultsToDeterministic(t *testing.T) {
|
|
if got := ClassOf(unclassifiedValidator{}); got != ExecutionClassDeterministic {
|
|
t.Fatalf("expected deterministic default class, got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestWrapExposesExecutionClass(t *testing.T) {
|
|
wrapped := Wrap(unclassifiedValidator{}, ExecutionClassLLMBacked)
|
|
if got := ClassOf(wrapped); got != ExecutionClassLLMBacked {
|
|
t.Fatalf("expected llm_backed class, got %q", got)
|
|
}
|
|
}
|