(t *testing.T)
| 159 | } |
| 160 | |
| 161 | func TestFromMetadata(t *testing.T) { |
| 162 | original := NewProvenance(SourceUserInput, "session-789") |
| 163 | original.Tags = []string{"test"} |
| 164 | original.Corroborate("session-790") |
| 165 | |
| 166 | meta := original.ToMetadata() |
| 167 | restored := FromMetadata(meta) |
| 168 | |
| 169 | if restored == nil { |
| 170 | t.Fatal("FromMetadata returned nil") |
| 171 | } |
| 172 | |
| 173 | if restored.SourceType != original.SourceType { |
| 174 | t.Errorf("SourceType = %v, want %v", restored.SourceType, original.SourceType) |
| 175 | } |
| 176 | |
| 177 | if restored.Confidence != original.Confidence { |
| 178 | t.Errorf("Confidence = %v, want %v", restored.Confidence, original.Confidence) |
| 179 | } |
| 180 | |
| 181 | if len(restored.Sources) != len(original.Sources) { |
| 182 | t.Errorf("Sources length = %d, want %d", len(restored.Sources), len(original.Sources)) |
| 183 | } |
| 184 | |
| 185 | if restored.Version != original.Version { |
| 186 | t.Errorf("Version = %v, want %v", restored.Version, original.Version) |
| 187 | } |
| 188 | |
| 189 | if restored.CorroborationCount != original.CorroborationCount { |
| 190 | t.Errorf("CorroborationCount = %v, want %v", restored.CorroborationCount, original.CorroborationCount) |
| 191 | } |
| 192 | |
| 193 | if len(restored.Tags) != len(original.Tags) { |
| 194 | t.Errorf("Tags length = %d, want %d", len(restored.Tags), len(original.Tags)) |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | func TestProvenance_MarkAccessed(t *testing.T) { |
| 199 | p := NewProvenance(SourceUserInput, "session-1") |
nothing calls this directly
no test coverage detected