MCPcopy Create free account
hub / github.com/cheat/cheat / assertNoPlaceholders

Function assertNoPlaceholders

test/integration/first_run_integration_test.go:241–259  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

239// in the config output. This is the regression check for #721 (literal
240// PAGER_PATH appearing in the config).
241func 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.

Callers 1

TestFirstRunIntegrationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected