(t *testing.T)
| 481 | } |
| 482 | |
| 483 | func TestExtractMetadataRealisticLockFile(t *testing.T) { |
| 484 | // Realistic lock file content with metadata |
| 485 | content := `# ___ _ _ |
| 486 | # / _ \ | | (_) |
| 487 | # | |_| | __ _ ___ _ __ | |_ _ ___ |
| 488 | # |
| 489 | # This file was automatically generated by gh-aw. DO NOT EDIT. |
| 490 | # |
| 491 | # Daily status report for gh-aw project |
| 492 | # |
| 493 | # Resolved workflow manifest: |
| 494 | # Imports: |
| 495 | # - shared/reporting.md |
| 496 | # |
| 497 | # gh-aw-metadata: {"schema_version":"v1","frontmatter_hash":"49266e50774d7e6a8b1c50f64b2f790c214dcdcf7b75b6bc8478bb43257b9863"} |
| 498 | |
| 499 | name: "Dev" |
| 500 | on: |
| 501 | schedule: |
| 502 | - cron: "0 9 * * *" |
| 503 | ` |
| 504 | |
| 505 | metadata, isLegacy, err := ExtractMetadataFromLockFile(content) |
| 506 | require.NoError(t, err, "Should parse realistic lock file") |
| 507 | assert.False(t, isLegacy, "Should not detect as legacy") |
| 508 | require.NotNil(t, metadata, "Should extract metadata") |
| 509 | assert.Equal(t, LockSchemaV1, metadata.SchemaVersion) |
| 510 | assert.Equal(t, "49266e50774d7e6a8b1c50f64b2f790c214dcdcf7b75b6bc8478bb43257b9863", metadata.FrontmatterHash) |
| 511 | } |
| 512 | |
| 513 | func TestExtractMetadataLegacyLockFile(t *testing.T) { |
| 514 | // Legacy lock file without metadata |
nothing calls this directly
no test coverage detected