Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for testPrinter (0.31 sec)

  1. staging/src/k8s.io/cli-runtime/pkg/printers/json_test.go

    }
    
    func (in *TestStruct) DeepCopyObject() runtime.Object {
    	panic("never called")
    }
    
    func TestJSONPrinter(t *testing.T) {
    	testPrinter(t, NewTypeSetter(scheme.Scheme).ToPrinter(&JSONPrinter{}), json.Unmarshal)
    }
    
    func testPrinter(t *testing.T, printer ResourcePrinter, unmarshalFunc func(data []byte, v interface{}) error) {
    	buf := bytes.NewBuffer([]byte{})
    
    	err := printer.PrintObj(&testData, buf)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 15:46:12 UTC 2023
    - 4K bytes
    - Viewed (0)
  2. staging/src/k8s.io/cli-runtime/pkg/printers/yaml_test.go

    limitations under the License.
    */
    
    package printers
    
    import (
    	"testing"
    
    	"sigs.k8s.io/yaml"
    
    	"k8s.io/client-go/kubernetes/scheme"
    )
    
    func TestYAMLPrinter(t *testing.T) {
    	testPrinter(t, NewTypeSetter(scheme.Scheme).ToPrinter(&YAMLPrinter{}), yamlUnmarshal)
    }
    
    func yamlUnmarshal(data []byte, v interface{}) error {
    	return yaml.Unmarshal(data, v)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 10 11:23:25 UTC 2021
    - 888 bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/TestWriter.java

    import java.io.IOException;
    import java.io.OutputStreamWriter;
    
    /** @author Colin Decker */
    public class TestWriter extends FilterWriter {
    
      private final TestOutputStream out;
    
      public TestWriter(TestOption... options) throws IOException {
        this(new TestOutputStream(ByteStreams.nullOutputStream(), options));
      }
    
      public TestWriter(TestOutputStream out) {
        super(new OutputStreamWriter(checkNotNull(out), UTF_8));
        this.out = out;
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Dec 04 17:37:03 UTC 2017
    - 1.7K bytes
    - Viewed (0)
  4. cmd/kubeadm/app/util/output/output.go

    	Printf(format string, args ...interface{}) (n int, err error)
    	Println(args ...interface{}) (n int, err error)
    }
    
    // TextPrinter implements Printer interface for generic text output
    type TextPrinter struct {
    }
    
    // PrintObj is an implementation of ResourcePrinter.PrintObj that prints object
    func (tp *TextPrinter) PrintObj(obj runtime.Object, writer io.Writer) error {
    	_, err := fmt.Fprintf(writer, "%+v\n", obj)
    	return err
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Apr 19 08:22:45 UTC 2024
    - 8K bytes
    - Viewed (0)
  5. pkg/kube/kclient/clienttest/test_helpers.go

    	c kclient.ReadWriter[T]
    	t test.Failer
    	TestWriter[T]
    }
    
    type TestWriter[T controllers.Object] struct {
    	c kclient.Writer[T]
    	t test.Failer
    }
    
    func (t TestClient[T]) Get(name, namespace string) T {
    	return t.c.Get(name, namespace)
    }
    
    func (t TestClient[T]) List(namespace string, selector klabels.Selector) []T {
    	return t.c.List(namespace, selector)
    }
    
    func (t TestWriter[T]) Create(object T) T {
    	t.t.Helper()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Feb 23 19:18:21 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  6. test/fixedbugs/issue15329.go

    	// Invocation via method expression.
    	check(unsafe.Pointer(reflect.Value.Pointer(testMeth(1))), unsafe.Pointer(reflect.Value.Pointer(testMeth(2))))
    
    	// Invocation via interface.
    	check(unsafe.Pointer(testInter(1).Pointer()), unsafe.Pointer(testInter(2).Pointer()))
    
    	// Invocation via method value.
    	check(unsafe.Pointer(testFunc(1)()), unsafe.Pointer(testFunc(2)()))
    }
    
    func check(p, q unsafe.Pointer) {
    	a, b := *(*int)(p), *(*int)(q)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 18 14:01:22 UTC 2016
    - 2.1K bytes
    - Viewed (0)
  7. src/go/doc/comment/text.go

    // license that can be found in the LICENSE file.
    
    package comment
    
    import (
    	"bytes"
    	"fmt"
    	"sort"
    	"strings"
    	"unicode/utf8"
    )
    
    // A textPrinter holds the state needed for printing a Doc as plain text.
    type textPrinter struct {
    	*Printer
    	long       strings.Builder
    	prefix     string
    	codePrefix string
    	width      int
    }
    
    // Text returns a textual formatting of the [Doc].
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 8.8K bytes
    - Viewed (0)
  8. src/mime/quotedprintable/writer_test.go

    // license that can be found in the LICENSE file.
    
    package quotedprintable
    
    import (
    	"bytes"
    	"io"
    	"strings"
    	"testing"
    )
    
    func TestWriter(t *testing.T) {
    	testWriter(t, false)
    }
    
    func TestWriterBinary(t *testing.T) {
    	testWriter(t, true)
    }
    
    func testWriter(t *testing.T, binary bool) {
    	tests := []struct {
    		in, want, wantB string
    	}{
    		{in: "", want: ""},
    		{in: "foo bar", want: "foo bar"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 17:36:47 UTC 2022
    - 5.1K bytes
    - Viewed (0)
  9. pkg/kube/kclient/clienttest/direct.go

    // NewWriter returns a new client for the given type.
    // Any errors will call t.Fatal.
    func NewWriter[T controllers.ComparableObject](t test.Failer, c kube.Client) TestWriter[T] {
    	return TestWriter[T]{t: t, c: kclient.NewWriteClient[T](c)}
    }
    
    // NewDirectClient returns a new client for the given type. Reads are directly to the API server.
    // Any errors will call t.Fatal.
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue Aug 08 16:43:05 UTC 2023
    - 3K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modfetch/codehost/git_test.go

    func newTestWriter(t testing.TB) *testWriter {
    	w := &testWriter{t: t}
    
    	t.Cleanup(func() {
    		w.mu.Lock()
    		defer w.mu.Unlock()
    		if b := w.buf.Bytes(); len(b) > 0 {
    			w.t.Logf("%s", b)
    			w.buf.Reset()
    		}
    	})
    
    	return w
    }
    
    func (w *testWriter) Write(p []byte) (int, error) {
    	w.mu.Lock()
    	defer w.mu.Unlock()
    	n, err := w.buf.Write(p)
    	if b := w.buf.Bytes(); len(b) > 0 && b[len(b)-1] == '\n' {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 14 19:46:23 UTC 2023
    - 18.9K bytes
    - Viewed (0)
Back to top