(t *testing.T)
| 511 | } |
| 512 | |
| 513 | func TestExtractMetadataLegacyLockFile(t *testing.T) { |
| 514 | // Legacy lock file without metadata |
| 515 | content := `# |
| 516 | # This file was automatically generated by gh-aw. DO NOT EDIT. |
| 517 | # |
| 518 | # frontmatter-hash: 49266e50774d7e6a8b1c50f64b2f790c214dcdcf7b75b6bc8478bb43257b9863 |
| 519 | |
| 520 | name: "Legacy" |
| 521 | on: push |
| 522 | ` |
| 523 | |
| 524 | metadata, isLegacy, err := ExtractMetadataFromLockFile(content) |
| 525 | require.NoError(t, err, "Should parse legacy lock file") |
| 526 | assert.True(t, isLegacy, "Should detect as legacy") |
| 527 | require.NotNil(t, metadata, "Should extract metadata with hash from legacy") |
| 528 | assert.Equal(t, "49266e50774d7e6a8b1c50f64b2f790c214dcdcf7b75b6bc8478bb43257b9863", metadata.FrontmatterHash, "Should extract hash from legacy") |
| 529 | |
| 530 | // Legacy format should validate successfully |
| 531 | err = ValidateLockSchemaCompatibility(content, "legacy.lock.yml") |
| 532 | assert.NoError(t, err, "Legacy lock files should be accepted") |
| 533 | } |
| 534 | |
| 535 | func TestMetadataPreservesHash(t *testing.T) { |
| 536 | // Test that frontmatter hash is preserved in metadata |
nothing calls this directly
no test coverage detected