Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for testWriter (0.18 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. operator/pkg/util/progress/progress.go

    	return prefix + msg
    }
    
    // For testing only
    var testWriter *io.Writer
    
    func createBar() *pb.ProgressBar {
    	// Don't set a total and use Static so we can explicitly control when you write. This is needed
    	// for handling the multiline issues.
    	bar := pb.New(0)
    	bar.Set(pb.Static, true)
    	if testWriter != nil {
    		bar.SetWriter(*testWriter)
    	}
    	bar.Start()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 14 19:23:44 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  7. operator/pkg/util/progress/progress_test.go

    package progress
    
    import (
    	"bytes"
    	"io"
    	"testing"
    
    	"istio.io/istio/operator/pkg/name"
    )
    
    func TestProgressLog(t *testing.T) {
    	buf := bytes.NewBuffer(nil)
    	testBuf := io.Writer(buf)
    	testWriter = &testBuf
    	expected := ""
    	expect := func(e string) {
    		t.Helper()
    		// In buffer mode we don't overwrite old data, so we are constantly appending to the expected
    		newExpected := expected + "\n" + e
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 14 19:23:44 UTC 2024
    - 2.1K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/io/CharSourceTest.java

        assertEquals(ImmutableList.of("foo"), list);
        assertTrue(lines.wasStreamOpened() && lines.wasStreamClosed());
      }
    
      public void testCopyToAppendable_doesNotCloseIfWriter() throws IOException {
        TestWriter writer = new TestWriter();
        assertFalse(writer.closed());
        source.copyTo(writer);
        assertFalse(writer.closed());
      }
    
      public void testClosesOnErrors_copyingToCharSinkThatThrows() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue May 07 15:26:58 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  9. istioctl/pkg/writer/table/writer_test.go

    	version   string
    }
    
    var newTestObject = func(name, namespace, version string) testObject {
    	return testObject{
    		name:      name,
    		namespace: namespace,
    		version:   version,
    	}
    }
    
    func TestWriter(t *testing.T) {
    	got := &bytes.Buffer{}
    	w := NewStyleWriter(got)
    	w.AddHeader("NAME", "NAMESPACE", "VERSION")
    	w.SetAddRowFunc(func(obj interface{}) Row {
    		o := obj.(testObject)
    		return Row{
    			Cells: []Cell{
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Oct 08 04:41:42 UTC 2022
    - 1.6K bytes
    - Viewed (0)
  10. src/mime/multipart/writer_test.go

    // license that can be found in the LICENSE file.
    
    package multipart
    
    import (
    	"bytes"
    	"io"
    	"mime"
    	"net/textproto"
    	"strings"
    	"testing"
    )
    
    func TestWriter(t *testing.T) {
    	fileContents := []byte("my file contents")
    
    	var b bytes.Buffer
    	w := NewWriter(&b)
    	{
    		part, err := w.CreateFormFile("myfile", "my-file.txt")
    		if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 17:36:47 UTC 2022
    - 4.1K bytes
    - Viewed (0)
Back to top