MCPcopy
hub / github.com/cli/cli / Test_detectEmptyFiles

Function Test_detectEmptyFiles

pkg/cmd/gist/create/create_test.go:393–417  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

391}
392
393func Test_detectEmptyFiles(t *testing.T) {
394 tests := []struct {
395 content string
396 isEmptyFile bool
397 }{
398 {
399 content: "{}",
400 isEmptyFile: false,
401 },
402 {
403 content: "\n\t",
404 isEmptyFile: true,
405 },
406 }
407
408 for _, tt := range tests {
409 files := map[string]*shared.GistFile{}
410 files["file"] = &shared.GistFile{
411 Content: tt.content,
412 }
413
414 isEmptyFile := detectEmptyFiles(files)
415 assert.Equal(t, tt.isEmptyFile, isEmptyFile)
416 }
417}

Callers

nothing calls this directly

Calls 2

detectEmptyFilesFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected