MCPcopy Index your code
hub / github.com/cheat/cheat / TestLoadBadPath

Function TestLoadBadPath

internal/sheets/load_test.go:54–69  ·  view source on GitHub ↗

TestLoadBadPath asserts that an error is returned if a cheatpath is invalid

(t *testing.T)

Source from the content-addressed store, hash-verified

52
53// TestLoadBadPath asserts that an error is returned if a cheatpath is invalid
54func TestLoadBadPath(t *testing.T) {
55
56 // mock a bad cheatpath
57 cheatpaths := []cheatpath.Path{
58 {
59 Name: "badpath",
60 Path: "/cheat/test/path/does/not/exist",
61 ReadOnly: true,
62 },
63 }
64
65 // attempt to load the cheatpath
66 if _, err := Load(cheatpaths); err == nil {
67 t.Errorf("failed to reject invalid cheatpath")
68 }
69}

Callers

nothing calls this directly

Calls 1

LoadFunction · 0.85

Tested by

no test coverage detected