You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: name_flags_test.go
    path of file: ./repos/kubernetes/staging/src/k8s.io/cli-runtime/pkg/genericclioptions
    
    the code of the file until where you have to start completion: /*
Copyright 2018 The Kubernetes Authors.

Licensed under th
    
func TestNamePrinterSupportsExpectedFormats(t *testing.T) {
	testObject := &v1.Pod{
		TypeMeta:   metav1.TypeMeta{APIVersion: "v1", Kind: "Pod"},
		ObjectMeta: metav1.ObjectMeta{Name: "foo"},
	}

	testCases := []struct {
		name           string
		outputFormat   string
		operation      string
		dryRun         bool
		expectedError  string
		expectedOutput string
		expectNoMatch  bool
	}{
		{
			name:           "valid \"name\" output format with no operation prints resource name",
			outputFormat:   "name",
			expectedOutput: "pod/foo",
		},
		{
			name:           "valid \"name\" output format and an operation results in a short-output (non success printer) message",
			outputFormat:   "name",
			operation:      "patched",
			expectedOutput: "pod/foo",
		},
		{
			name:          "operation and no valid \"name\" output does not match a printer",
			operation:     "patched",
			outputFormat:  "invalid",
			dryRun:        true,
			expectNoMatch: true,
		},
		{
			name:           "operation and empty output still matches name printer",
			expectedOutput: "pod/foo patched",
			operation:      "patched",
		},
		{
			name:          "no printer is matched on an invalid outputFormat",
			outputFormat:  "invalid",
			expectNoMatch: true,
		},
		{
			name:          "printer should not match on any other format supported by another printer",
			outputFormat:  "go-template",
			expectNoMatch: true,
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			printFlags := NamePrintFlags{
				Operation: tc.operation,
			}

			p, err := printFlags.ToPrinter(tc.outputFormat)
			if tc.expectNoMatch {
				if !IsNoCompatiblePrinterError(err) {
					t.Fatalf("expected no printer matches for output format %q", tc.outputFormat)
				}
				return
			}
			if IsNoCompatiblePrinterError(err) {
				t.Fatalf("expected to match name printer for output format %q", tc.outputFormat)
			}

			if len(tc.expectedError) > 0 {
				if err == nil || !strings.Contains(err.Error(), tc.expectedError) {
					t.Errorf("expecting error %q, got %v", tc.expectedError, err)
				}
				return
			}
			if err != nil {
				t.Fatalf("unexpected error: %v", err)
			}

			out := bytes.NewBuffer([]byte{})
			err = p.PrintObj(testObject, out)
			if err != nil {
				t.Errorf("unexpected error: %v", err)
			}

			if !strings.Contains(out.String(), tc.expectedOutput) {
				t.Errorf("unexpected output: expecting %q, got %q", tc.expectedOutput, out.String())
			}
		})
	}
}