func TestPut(t *testing.T) {
	bx := NewTestDB()
	defer bx.Close()

	things, err := bx.New([]byte("things"))
	if err != nil {
		t.Error(err.Error())
	}

	key, value := []byte("A"), []byte("alpha")

	// Put key/value into the `things` bucket.
	if err := things.Put(key, value); err != nil {
		t.Error(err.Error())
	}

	// Read value back in a different read-only transaction.
	got, err := things.Get(key)
	if err != nil && !bytes.Equal(got, value) {
		t.Error(err.Error())
	}
}
// Ensure we can put an item in a bucket.
Ensure we can put an item in a bucket.
// Ensure we can put an item in a bucket .
func TestPut(t *testing.T) {
	bx := NewTestDB()
	defer bx.Close()
	things, err := bx.New([]byte("things"))
	if err != nil {
		t.Error(err.Error())
	}
	key, value := []byte("A"), []byte("alpha")
	if err := things.Put(key, value); err != nil {
		t.Error(err.Error())
	}
	got, err := things.Get(key)
	if err != nil && !bytes.Equal(got, value) {
		t.Error(err.Error())
	}
}
func TestPut ( t * testing . T ) { bx := NewTestDB ( ) defer bx . Close ( ) things , err := bx . New ( [ ] byte ( " " ) ) if err != nil { t . Error ( err . Error ( ) ) } key , value := [ ] byte ( " " ) , [ ] byte ( " " ) if err := things . Put ( key , value ) ; err != nil { t . Error ( err . Error ( ) ) } got , err := things . Get ( key ) if err != nil && ! bytes . Equal ( got , value ) { t . Error ( err . Error ( ) ) } }
Ensure we can put an item in a bucket.
Ensure we can put an item in a bucket .
// Put key/value into the `things` bucket. // Read value back in a different read-only transaction.