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

Function TestResolveInputFlags_Stdin

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

Source from the content-addressed store, hash-verified

46}
47
48func TestResolveInputFlags_Stdin(t *testing.T) {
49 rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "-"}, "content from stdin")
50 flags := []Flag{{Name: "markdown", Input: []string{File, Stdin}}}
51
52 if err := resolveInputFlags(rctx, flags); err != nil {
53 t.Fatalf("unexpected error: %v", err)
54 }
55 if got := rctx.Str("markdown"); got != "content from stdin" {
56 t.Errorf("expected %q, got %q", "content from stdin", got)
57 }
58}
59
60func TestResolveInputFlags_File(t *testing.T) {
61 dir := t.TempDir()

Callers

nothing calls this directly

Calls 3

newTestRuntimeWithStdinFunction · 0.85
resolveInputFlagsFunction · 0.85
StrMethod · 0.65

Tested by

no test coverage detected