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

Function TestResolveInput_AtFile_EmptyContent

internal/cmdutil/resolve_test.go:176–187  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

174}
175
176func TestResolveInput_AtFile_EmptyContent(t *testing.T) {
177 fio := &localfileio.LocalFileIO{}
178 dir := t.TempDir()
179 TestChdir(t, dir)
180 if err := os.WriteFile("empty.json", []byte(" \n"), 0o600); err != nil {
181 t.Fatal(err)
182 }
183 _, err := ResolveInput("@empty.json", nil, fio)
184 if err == nil || !strings.Contains(err.Error(), "is empty") {
185 t.Errorf("expected empty-file error, got: %v", err)
186 }
187}
188
189func TestResolveInput_AtFile_NoFileIO(t *testing.T) {
190 // When fileIO is nil, @path must error rather than silently fall back.

Callers

nothing calls this directly

Calls 5

TestChdirFunction · 0.85
ResolveInputFunction · 0.85
WriteFileMethod · 0.65
ContainsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected