assertNoPlaceholders verifies that no template placeholder strings survived in the config output. This is the regression check for #721 (literal PAGER_PATH appearing in the config).
(t *testing.T, content string)
| 239 | // in the config output. This is the regression check for #721 (literal |
| 240 | // PAGER_PATH appearing in the config). |
| 241 | func assertNoPlaceholders(t *testing.T, content string) { |
| 242 | t.Helper() |
| 243 | placeholders := []string{ |
| 244 | "PAGER_PATH", |
| 245 | "COMMUNITY_PATH", |
| 246 | "PERSONAL_PATH", |
| 247 | "WORK_PATH", |
| 248 | } |
| 249 | for _, p := range placeholders { |
| 250 | if strings.Contains(content, p) { |
| 251 | t.Errorf("placeholder %q was not replaced in config", p) |
| 252 | } |
| 253 | } |
| 254 | // EDITOR_PATH is special: it survives if no editor is found. |
| 255 | // In our test env EDITOR=vi is set, so it should be replaced. |
| 256 | if strings.Contains(content, "editor: EDITOR_PATH") { |
| 257 | t.Error("placeholder EDITOR_PATH was not replaced in config") |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | // assertCommunityCommentedOut verifies that the community cheatpath entry |
| 262 | // is commented out (not active) in the config. |
no outgoing calls
no test coverage detected