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

Function TestResolveInputFlags_EmptyFilePath

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

Source from the content-addressed store, hash-verified

167}
168
169func TestResolveInputFlags_EmptyFilePath(t *testing.T) {
170 rctx := newTestRuntimeWithStdin(map[string]string{"markdown": "@ "}, "")
171 flags := []Flag{{Name: "markdown", Input: []string{File, Stdin}}}
172
173 err := resolveInputFlags(rctx, flags)
174 if err == nil {
175 t.Fatal("expected error for empty file path")
176 }
177 vErr := assertValidationParam(t, err, "--markdown")
178 if !strings.Contains(vErr.Message, "file path cannot be empty after @") {
179 t.Errorf("unexpected error message: %q", vErr.Message)
180 }
181}
182
183func TestResolveInputFlags_EscapeAtSign(t *testing.T) {
184 rctx := newTestRuntimeWithStdin(map[string]string{"text": "@@mention someone"}, "")

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected