MCPcopy Create free account
hub / github.com/cli/cli / Test_detectEmptyFiles

Function Test_detectEmptyFiles

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

Source from the content-addressed store, hash-verified

393}
394
395func Test_detectEmptyFiles(t *testing.T) {
396 tests := []struct {
397 content string
398 isEmptyFile bool
399 }{
400 {
401 content: "{}",
402 isEmptyFile: false,
403 },
404 {
405 content: "\n\t",
406 isEmptyFile: true,
407 },
408 }
409
410 for _, tt := range tests {
411 files := map[string]*shared.GistFile{}
412 files["file"] = &shared.GistFile{
413 Content: tt.content,
414 }
415
416 isEmptyFile := detectEmptyFiles(files)
417 assert.Equal(t, tt.isEmptyFile, isEmptyFile)
418 }
419}
420
421// Test_createGist_missingScope pins the scopes suggestion, which is the reason this call site
422// declares the gist scope rather than relying on what the API reports.

Callers

nothing calls this directly

Calls 2

detectEmptyFilesFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected