feat(bsr): Define initial interfaces and types

This commit is contained in:
Timothy Messier committed 2023-05-31 12:18:08 +00:00
1 parent b73d4bd0d2
commit 658bb27eeb
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())
}