MCPcopy Create free account
hub / github.com/dnote/dnote / TestFormatQuestion

Function TestFormatQuestion

pkg/prompt/prompt_test.go:25–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

23)
24
25func TestFormatQuestion(t *testing.T) {
26 testCases := []struct {
27 question string
28 optimistic bool
29 expected string
30 }{
31 {
32 question: "Are you sure?",
33 optimistic: false,
34 expected: "Are you sure? (y/N)",
35 },
36 {
37 question: "Continue?",
38 optimistic: true,
39 expected: "Continue? (Y/n)",
40 },
41 }
42
43 for _, tc := range testCases {
44 t.Run(tc.question, func(t *testing.T) {
45 result := FormatQuestion(tc.question, tc.optimistic)
46 assert.Equal(t, result, tc.expected, "formatted question mismatch")
47 })
48 }
49}
50
51func TestReadYesNo(t *testing.T) {
52 testCases := []struct {

Callers

nothing calls this directly

Calls 2

EqualFunction · 0.92
FormatQuestionFunction · 0.85

Tested by

no test coverage detected