You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
boundary/internal/bsr/compression_null_compressio...

31 lines
581 B

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
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())
}