mirror of
https://github.com/syntrex-lab/gomcp.git
synced 2026-04-27 21:36:21 +02:00
Release prep: 54 engines, self-hosted signatures, i18n, dashboard updates
This commit is contained in:
parent
694e32be26
commit
41cbfd6e0a
178 changed files with 36008 additions and 399 deletions
62
internal/domain/synapse/synapse_test.go
Normal file
62
internal/domain/synapse/synapse_test.go
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
package synapse
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
// --- Status Constants ---
|
||||
|
||||
func TestStatusConstants(t *testing.T) {
|
||||
assert.Equal(t, Status("PENDING"), StatusPending)
|
||||
assert.Equal(t, Status("VERIFIED"), StatusVerified)
|
||||
assert.Equal(t, Status("REJECTED"), StatusRejected)
|
||||
}
|
||||
|
||||
func TestStatusConstants_Distinct(t *testing.T) {
|
||||
statuses := []Status{StatusPending, StatusVerified, StatusRejected}
|
||||
seen := make(map[Status]bool)
|
||||
for _, s := range statuses {
|
||||
assert.False(t, seen[s], "duplicate status: %s", s)
|
||||
seen[s] = true
|
||||
}
|
||||
}
|
||||
|
||||
// --- Synapse Struct ---
|
||||
|
||||
func TestSynapseStruct_ZeroValue(t *testing.T) {
|
||||
var s Synapse
|
||||
assert.Zero(t, s.ID)
|
||||
assert.Empty(t, s.FactIDA)
|
||||
assert.Empty(t, s.FactIDB)
|
||||
assert.Zero(t, s.Confidence)
|
||||
assert.Empty(t, s.Status)
|
||||
assert.True(t, s.CreatedAt.IsZero())
|
||||
}
|
||||
|
||||
func TestSynapseStruct_FieldAssignment(t *testing.T) {
|
||||
s := Synapse{
|
||||
ID: 42,
|
||||
FactIDA: "fact-001",
|
||||
FactIDB: "fact-002",
|
||||
Confidence: 0.95,
|
||||
Status: StatusVerified,
|
||||
}
|
||||
assert.Equal(t, int64(42), s.ID)
|
||||
assert.Equal(t, "fact-001", s.FactIDA)
|
||||
assert.Equal(t, "fact-002", s.FactIDB)
|
||||
assert.InDelta(t, 0.95, s.Confidence, 0.001)
|
||||
assert.Equal(t, StatusVerified, s.Status)
|
||||
}
|
||||
|
||||
// --- SynapseStore Interface Compliance ---
|
||||
|
||||
// Verify that the SynapseStore interface is well-formed by checking
|
||||
// it can be used as a type constraint.
|
||||
func TestSynapseStoreInterface_Compilable(t *testing.T) {
|
||||
// This test verifies the interface definition compiles correctly.
|
||||
// runtime verification uses a nil assertion.
|
||||
var store SynapseStore
|
||||
assert.Nil(t, store, "nil interface should work")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue