24 lines
329 B
Go
24 lines
329 B
Go
package transient
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
var k, v = []byte("hello"), []byte("world")
|
|
|
|
func TestTransientStore(t *testing.T) {
|
|
tstore := NewStore()
|
|
|
|
require.Nil(t, tstore.Get(k))
|
|
|
|
tstore.Set(k, v)
|
|
|
|
require.Equal(t, v, tstore.Get(k))
|
|
|
|
tstore.Commit()
|
|
|
|
require.Nil(t, tstore.Get(k))
|
|
}
|