MCPcopy
hub / github.com/cheat/cheat / TestFindLocalCheatpathNotFound

Function TestFindLocalCheatpathNotFound

internal/config/config_test.go:120–131  ·  view source on GitHub ↗

TestFindLocalCheatpathNotFound tests that empty string is returned when no .cheat exists

(t *testing.T)

Source from the content-addressed store, hash-verified

118
119// TestFindLocalCheatpathNotFound tests that empty string is returned when no .cheat exists
120func TestFindLocalCheatpathNotFound(t *testing.T) {
121 tempDir, err := os.MkdirTemp("", "cheat-test-*")
122 if err != nil {
123 t.Fatalf("failed to create temp dir: %v", err)
124 }
125 defer os.RemoveAll(tempDir)
126
127 result := findLocalCheatpath(tempDir)
128 if result != "" {
129 t.Errorf("expected empty string, got %s", result)
130 }
131}
132
133// TestFindLocalCheatpathSkipsFile tests that a file named .cheat is not matched
134func TestFindLocalCheatpathSkipsFile(t *testing.T) {

Callers

nothing calls this directly

Calls 1

findLocalCheatpathFunction · 0.85

Tested by

no test coverage detected