feat(bsr): Define initial interfaces and types
This commit is contained in:
19 files changed
+1147
No files matched your search
@@ -0,0 +1,30 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package bsr
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNullCompressionWriter(t *testing.T) {
|
||||
var buf bytes.Buffer
|
||||
var compressor io.WriteCloser
|
||||
|
||||
expect := []byte("uncompressed data")
|
||||
compressor = newNullCompressionWriter(&buf)
|
||||
|
||||
wrote, err := compressor.Write(expect)
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, len(expect), wrote)
|
||||
|
||||
err = compressor.Close()
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, expect, buf.Bytes())
|
||||
}
|
||||
Reference in new issue
Block a user