MCPcopy
hub / github.com/c-bata/go-prompt / TestPosixParserGetKey

Function TestPosixParserGetKey

input_test.go:7–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestPosixParserGetKey(t *testing.T) {
8 scenarioTable := []struct {
9 name string
10 input []byte
11 expected Key
12 }{
13 {
14 name: "escape",
15 input: []byte{0x1b},
16 expected: Escape,
17 },
18 {
19 name: "undefined",
20 input: []byte{'a'},
21 expected: NotDefined,
22 },
23 }
24
25 for _, s := range scenarioTable {
26 t.Run(s.name, func(t *testing.T) {
27 key := GetKey(s.input)
28 if key != s.expected {
29 t.Errorf("Should be %s, but got %s", key, s.expected)
30 }
31 })
32 }
33}

Callers

nothing calls this directly

Calls 2

GetKeyFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…