Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 84 for ReadAll (0.37 sec)

  1. cmd/dummy-data-generator_test.go

    }
    
    func TestDummyDataGenerator(t *testing.T) {
    	readAll := func(r io.Reader) string {
    		b, _ := io.ReadAll(r)
    		return string(b)
    	}
    	checkEq := func(a, b string) {
    		if a != b {
    			t.Fatalf("Unexpected equality failure")
    		}
    	}
    
    	checkEq(readAll(NewDummyDataGen(0, 0)), "")
    
    	checkEq(readAll(NewDummyDataGen(10, 0)), readAll(NewDummyDataGen(10, int64(len(alphabets)))))
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  2. istioctl/pkg/writer/envoy/configdump/secret_test.go

    	}
    	defer configDumpFile.Close()
    	configDump, err := io.ReadAll(configDumpFile)
    	if err != nil {
    		t.Errorf("error reading test data file: %v", err)
    	}
    
    	outFile, err := os.Open("testdata/secret/output")
    	if err != nil {
    		t.Errorf("error opening test data output file: %v", err)
    	}
    	defer outFile.Close()
    	expectedOut, err := io.ReadAll(outFile)
    	if err != nil {
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Jun 06 15:14:48 GMT 2023
    - 1.5K bytes
    - Viewed (0)
  3. internal/config/crypto_test.go

    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    		data, err := io.ReadAll(ciphertext)
    		if err != nil {
    			t.Fatalf("Test %d: failed to encrypt stream: %v", i, err)
    		}
    
    		plaintext, err := Decrypt(KMS, bytes.NewReader(data), test.Context)
    		if err != nil {
    			t.Fatalf("Test %d: failed to decrypt stream: %v", i, err)
    		}
    		data, err = io.ReadAll(plaintext)
    		if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.2K bytes
    - Viewed (0)
  4. src/archive/zip/fuzz_test.go

    		type file struct {
    			header  *FileHeader
    			content []byte
    		}
    		files := []file{}
    
    		for _, f := range r.File {
    			fr, err := f.Open()
    			if err != nil {
    				continue
    			}
    			content, err := io.ReadAll(fr)
    			if err != nil {
    				continue
    			}
    			files = append(files, file{header: &f.FileHeader, content: content})
    			if _, err := r.Open(f.Name); err != nil {
    				continue
    			}
    		}
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Jan 13 18:06:33 GMT 2022
    - 1.7K bytes
    - Viewed (0)
  5. internal/config/crypto.go

    // ciphertext.
    func EncryptBytes(k kms.KMS, plaintext []byte, context kms.Context) ([]byte, error) {
    	ciphertext, err := Encrypt(k, bytes.NewReader(plaintext), context)
    	if err != nil {
    		return nil, err
    	}
    	return io.ReadAll(ciphertext)
    }
    
    // DecryptBytes decrypts the ciphertext using a key managed by the KMS.
    // The same context that have been used during encryption must be
    // provided.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 06 16:56:10 GMT 2023
    - 4.8K bytes
    - Viewed (0)
  6. src/archive/zip/writer_test.go

    		if err != nil {
    			t.Errorf("%s: Open err = %v", got.Name, err)
    			continue
    		}
    
    		buf, err := io.ReadAll(r)
    		if err != nil {
    			t.Errorf("%s: ReadAll err = %v", got.Name, err)
    			continue
    		}
    
    		if !bytes.Equal(buf, want.content) {
    			t.Errorf("%v: ReadAll returned unexpected bytes", got.Name)
    		}
    	}
    }
    
    func testCreate(t *testing.T, w *Writer, wt *WriteTest) {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Sep 15 19:04:06 GMT 2023
    - 14.1K bytes
    - Viewed (0)
  7. cni/pkg/log/uds_test.go

    	_ = log.Sync()
    
    	// Restore os stdout.
    	os.Stdout = stdout
    	assert.NoError(t, log.Configure(loggingOptions))
    
    	assert.NoError(t, w.Close())
    	out, err := io.ReadAll(r)
    	assert.NoError(t, err)
    
    	// For each level, there should be two lines, one from direct log,
    	// the other one from UDS server
    	wantLevels := []string{"debug", "info", "warn", "error", "debug", "info", "warn", "error"}
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Sat Mar 16 00:20:01 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  8. cmd/erasure-healing_test.go

    	if err != nil {
    		t.Fatalf("Failed to getLatestFileInfo - %v", err)
    	}
    
    	part1Disk1Origin, err := firstDisk.ReadAll(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"))
    	if err != nil {
    		t.Fatalf("Failed to read a file - %v", err)
    	}
    
    	part1Disk2Origin, err := secondDisk.ReadAll(context.Background(), bucket, pathJoin(object, fi.DataDir, "part.1"))
    	if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Wed Mar 27 15:10:40 GMT 2024
    - 47.6K bytes
    - Viewed (0)
  9. internal/config/subnet/subnet.go

    		Timeout:   10 * time.Second,
    		Transport: c.transport,
    	}
    
    	resp, err := client.Do(r)
    	if err != nil {
    		return "", err
    	}
    	defer xhttp.DrainBody(resp.Body)
    
    	respBytes, err := io.ReadAll(io.LimitReader(resp.Body, respBodyLimit))
    	if err != nil {
    		return "", err
    	}
    	respStr := string(respBytes)
    
    	if resp.StatusCode == http.StatusOK {
    		return respStr, nil
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 27 16:35:36 GMT 2023
    - 2.9K bytes
    - Viewed (0)
  10. internal/s3select/sql/jsonpath_test.go

    		return nil, err
    	}
    	return result, nil
    }
    
    func TestJsonpathEval(t *testing.T) {
    	f, err := os.Open(filepath.Join("jsondata", "books.json"))
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	b, err := io.ReadAll(f)
    	if err != nil {
    		t.Fatal(err)
    	}
    
    	p := participle.MustBuild(
    		&JSONPath{},
    		participle.Lexer(sqlLexer),
    		participle.CaseInsensitive("Keyword"),
    	)
    	cases := []struct {
    		str string
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 2.8K bytes
    - Viewed (0)
Back to top