MCPcopy Create free account
hub / github.com/catppuccin/cli / TestHandleDir

Function TestHandleDir

internal/utils/utils_test.go:10–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestHandleDir(t *testing.T) {
11 assert := is.New(t)
12
13 os.Setenv("CATPPUCCIN", "pog")
14 os.Setenv("NEOVIM", "chad/")
15
16 r1 := HandleDir("this/shouldnt/change")
17 assert.True(r1 == "this/shouldnt/change") // Unchanging directory should not change
18
19 r2 := HandleDir("$CATPPUCCIN/is/pog")
20 assert.True(r2 == "pog/is/pog") // Catppuccin should always be pog
21
22 r3 := HandleDir("catppuccin/is/$CATPPUCCIN/nice")
23 assert.True(r3 == "catppuccin/is/pog/nice") // Catppuccin should always be pog, even in the middle
24
25 r4 := HandleDir("neovim/is/a/$NEOVIM/text/editor")
26 assert.True(r4 == "neovim/is/a/chad/text/editor") // Neovim should always be a chad editor
27}

Callers

nothing calls this directly

Calls 1

HandleDirFunction · 0.85

Tested by

no test coverage detected