MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestMemoryReader_Header

Function TestMemoryReader_Header

internal/caches/reader_memory_test.go:5–21  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

3import "testing"
4
5func TestMemoryReader_Header(t *testing.T) {
6 item := &MemoryItem{
7 ExpiresAt: 0,
8 HeaderValue: []byte("0123456789"),
9 BodyValue: nil,
10 Status: 2000,
11 }
12 reader := NewMemoryReader(item)
13 buf := make([]byte, 6)
14 err := reader.ReadHeader(buf, func(n int) (goNext bool, err error) {
15 t.Log("buf:", string(buf[:n]))
16 return true, nil
17 })
18 if err != nil {
19 t.Fatal(err)
20 }
21}
22
23func TestMemoryReader_Body(t *testing.T) {
24 item := &MemoryItem{

Callers

nothing calls this directly

Calls 3

ReadHeaderMethod · 0.95
NewMemoryReaderFunction · 0.85
LogMethod · 0.80

Tested by

no test coverage detected