MCPcopy Create free account
hub / github.com/github/gh-aw / TestLockMetadataToJSONWithoutStopTime

Function TestLockMetadataToJSONWithoutStopTime

pkg/workflow/lock_schema_test.go:609–623  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

607}
608
609func TestLockMetadataToJSONWithoutStopTime(t *testing.T) {
610 // Test JSON serialization omits stop time when empty (omitempty)
611 metadata := &LockMetadata{
612 SchemaVersion: LockSchemaV1,
613 FrontmatterHash: "test123",
614 StopTime: "",
615 }
616
617 json, err := metadata.ToJSON()
618 require.NoError(t, err)
619 assert.Contains(t, json, `"schema_version":"v1"`)
620 assert.Contains(t, json, `"frontmatter_hash":"test123"`)
621 // Should not contain stop_time field when empty due to omitempty
622 assert.NotContains(t, json, `"stop_time"`)
623}
624
625func TestGenerateLockMetadataWithAgentInfo(t *testing.T) {
626 hash := "abcd1234"

Callers

nothing calls this directly

Calls 1

ToJSONMethod · 0.95

Tested by

no test coverage detected