MCPcopy
hub / github.com/larksuite/cli / TestResolveInputFlags_DirectValue

Function TestResolveInputFlags_DirectValue

shortcuts/common/runner_input_test.go:36–46  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

34}
35
36func TestResolveInputFlags_DirectValue(t *testing.T) {
37 rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "hello world"}, "")
38 flags := []Flag{{Name: "markdown", Input: []string{File, Stdin}}}
39
40 if err := resolveInputFlags(rctx, flags); err != nil {
41 t.Fatalf("unexpected error: %v", err)
42 }
43 if got := rctx.Str("markdown"); got != "hello world" {
44 t.Errorf("expected %q, got %q", "hello world", got)
45 }
46}
47
48func TestResolveInputFlags_Stdin(t *testing.T) {
49 rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "-"}, "content from stdin")

Callers

nothing calls this directly

Calls 3

newTestRuntimeWithStdinFunction · 0.85
resolveInputFlagsFunction · 0.85
StrMethod · 0.65

Tested by

no test coverage detected