(t *testing.T)
| 72 | } |
| 73 | |
| 74 | func TestMaybeAutoUpgradeIdempotent(t *testing.T) { |
| 75 | home := withTempHome(t) |
| 76 | withVersion(t, "v1.0.0") |
| 77 | if rc := cmdSkill([]string{"install"}); rc != 0 { |
| 78 | t.Fatalf("install rc=%d", rc) |
| 79 | } |
| 80 | skillPath := filepath.Join(home, ".claude", "skills", "flow", "SKILL.md") |
| 81 | before, _ := os.Stat(skillPath) |
| 82 | |
| 83 | // Same version → no rewrite. |
| 84 | maybeAutoUpgradeSkill() |
| 85 | |
| 86 | after, err := os.Stat(skillPath) |
| 87 | if err != nil { |
| 88 | t.Fatal(err) |
| 89 | } |
| 90 | if !before.ModTime().Equal(after.ModTime()) { |
| 91 | t.Error("auto-upgrade rewrote SKILL.md when version was unchanged") |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | func TestMaybeAutoUpgradeSkipsForDev(t *testing.T) { |
| 96 | home := withTempHome(t) |
nothing calls this directly
no test coverage detected