Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for testReadLine (0.18 sec)

  1. src/net/textproto/reader_test.go

    	"bufio"
    	"bytes"
    	"io"
    	"net"
    	"reflect"
    	"runtime"
    	"strings"
    	"sync"
    	"testing"
    )
    
    func reader(s string) *Reader {
    	return NewReader(bufio.NewReader(strings.NewReader(s)))
    }
    
    func TestReadLine(t *testing.T) {
    	r := reader("line1\nline2\n")
    	s, err := r.ReadLine()
    	if s != "line1" || err != nil {
    		t.Fatalf("Line 1: %s, %v", s, err)
    	}
    	s, err = r.ReadLine()
    	if s != "line2" || err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 05 18:31:56 UTC 2024
    - 14.7K bytes
    - Viewed (0)
  2. src/context/x_test.go

    	o := otherContext{c}
    	testDeadline(o, "WithDeadline+otherContext", t)
    
    	c, _ = WithDeadline(Background(), time.Now().Add(shortDuration))
    	o = otherContext{c}
    	c, _ = WithDeadline(o, time.Now().Add(veryLongDuration))
    	testDeadline(c, "WithDeadline+otherContext+WithDeadline", t)
    
    	c, _ = WithDeadline(Background(), time.Now().Add(-shortDuration))
    	testDeadline(c, "WithDeadline+inthepast", t)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 26.3K bytes
    - Viewed (0)
Back to top