(t *testing.T)
| 93 | } |
| 94 | |
| 95 | func TestMaybeAutoUpgradeSkipsForDev(t *testing.T) { |
| 96 | home := withTempHome(t) |
| 97 | withVersion(t, "v1.0.0") |
| 98 | if rc := cmdSkill([]string{"install"}); rc != 0 { |
| 99 | t.Fatalf("install rc=%d", rc) |
| 100 | } |
| 101 | skillPath := filepath.Join(home, ".claude", "skills", "flow", "SKILL.md") |
| 102 | if err := os.WriteFile(skillPath, []byte("dev edits"), 0o644); err != nil { |
| 103 | t.Fatal(err) |
| 104 | } |
| 105 | |
| 106 | // Dev build → must not touch user-edited skill. |
| 107 | Version = "dev" |
| 108 | maybeAutoUpgradeSkill() |
| 109 | |
| 110 | got, _ := os.ReadFile(skillPath) |
| 111 | if string(got) != "dev edits" { |
| 112 | t.Error("dev build clobbered locally-edited SKILL.md") |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | func TestMaybeAutoUpgradeSkipsWhenSkillMissing(t *testing.T) { |
| 117 | withTempHome(t) |
nothing calls this directly
no test coverage detected