github.com/scottcagno/storage@v1.8.0/pkg/_se/record_test.go (about)

     1  package _se
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  )
     7  
     8  func TestRecord_MakeRecord(t *testing.T) {
     9  
    10  	r1 := makeRecord(1, []byte("this record will fit in one (64b) page, not two"))
    11  	raw := r1.raw()
    12  	fmt.Printf("%s\nRAW:%q (len=%d)\n\n", r1, raw, len(raw))
    13  
    14  	r2 := makeRecord(2, []byte("this record is a little bit longer than the first one--it should end up occupying two pages but not three"))
    15  	fmt.Printf("%s\n\n", r2)
    16  
    17  	r3 := makeRecord(3, []byte("and this record is going to be a bit longer than the second one and ideally we should aim to fill three pages, but not four. this one should suffice."))
    18  	fmt.Printf("%s\n\n", r3)
    19  }