MCPcopy Create free account
hub / github.com/Effect-TS/tsgo / TestEnterCommandLineMode_Nesting

Function TestEnterCommandLineMode_Nesting

etscore/climode_test.go:39–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

37}
38
39func TestEnterCommandLineMode_Nesting(t *testing.T) {
40 commandLineMode.Store(false)
41
42 restore1 := EnterCommandLineMode()
43 restore2 := EnterCommandLineMode()
44
45 if !IsCommandLineMode() {
46 t.Fatal("expected true after nested enter")
47 }
48
49 restore2()
50 // Inner restore should keep it true since prev was already true.
51 if !IsCommandLineMode() {
52 t.Fatal("expected true after inner restore (prev was true)")
53 }
54
55 restore1()
56 if IsCommandLineMode() {
57 t.Fatal("expected false after outer restore")
58 }
59}

Callers

nothing calls this directly

Calls 2

EnterCommandLineModeFunction · 0.85
IsCommandLineModeFunction · 0.85

Tested by

no test coverage detected