TestHasLocalModifications tests the local modifications detection
(t *testing.T)
| 589 | |
| 590 | // TestHasLocalModifications tests the local modifications detection |
| 591 | func TestHasLocalModifications(t *testing.T) { |
| 592 | tests := []struct { |
| 593 | name string |
| 594 | sourceContent string |
| 595 | localContent string |
| 596 | sourceSpec string |
| 597 | expectModified bool |
| 598 | description string |
| 599 | }{ |
| 600 | { |
| 601 | name: "no modifications - identical content", |
| 602 | sourceContent: `--- |
| 603 | on: push |
| 604 | engine: claude |
| 605 | --- |
| 606 | |
| 607 | # Test Workflow |
| 608 | |
| 609 | Test content.`, |
| 610 | localContent: `--- |
| 611 | on: push |
| 612 | engine: claude |
| 613 | source: test/repo/workflow.md@v1.0.0 |
| 614 | --- |
| 615 | |
| 616 | # Test Workflow |
| 617 | |
| 618 | Test content.`, |
| 619 | sourceSpec: "test/repo/workflow.md@v1.0.0", |
| 620 | expectModified: false, |
| 621 | description: "Local file with source field should match source without it", |
| 622 | }, |
| 623 | { |
| 624 | name: "local modifications in frontmatter", |
| 625 | sourceContent: `--- |
| 626 | on: push |
| 627 | engine: claude |
| 628 | --- |
| 629 | |
| 630 | # Test Workflow |
| 631 | |
| 632 | Test content.`, |
| 633 | localContent: `--- |
| 634 | on: push |
| 635 | engine: claude |
| 636 | permissions: |
| 637 | contents: read |
| 638 | source: test/repo/workflow.md@v1.0.0 |
| 639 | --- |
| 640 | |
| 641 | # Test Workflow |
| 642 | |
| 643 | Test content.`, |
| 644 | sourceSpec: "test/repo/workflow.md@v1.0.0", |
| 645 | expectModified: true, |
| 646 | description: "Local has extra permissions field", |
| 647 | }, |
| 648 | { |
nothing calls this directly
no test coverage detected