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

Function TestResolveInputFlags_FileNotFound

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

Source from the content-addressed store, hash-verified

150}
151
152func TestResolveInputFlags_FileNotFound(t *testing.T) {
153 dir := t.TempDir()
154 cmdutil.TestChdir(t, dir)
155
156 rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "@nonexistent.md"}, "")
157 flags := []Flag{{Name: "markdown", Input: []string{File, Stdin}}}
158
159 err := resolveInputFlags(rctx, flags)
160 if err == nil {
161 t.Fatal("expected error for missing file")
162 }
163 vErr := assertValidationParam(t, err, "--markdown")
164 if !strings.Contains(vErr.Message, "cannot read file") {
165 t.Errorf("unexpected error message: %q", vErr.Message)
166 }
167}
168
169func TestResolveInputFlags_EmptyFilePath(t *testing.T) {
170 rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "@ "}, "")

Callers

nothing calls this directly

Calls 5

TestChdirFunction · 0.92
newTestRuntimeWithStdinFunction · 0.85
resolveInputFlagsFunction · 0.85
assertValidationParamFunction · 0.70
ContainsMethod · 0.45

Tested by

no test coverage detected