mirror of
https://github.com/mxpv/podsync.git
synced 2024-05-11 05:55:04 +00:00
26 lines
430 B
Go
26 lines
430 B
Go
package storage
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/mxpv/podsync/pkg/model"
|
|
)
|
|
|
|
func TestCompress(t *testing.T) {
|
|
inData := []model.Item{
|
|
{ID: "1", Title: "title1"},
|
|
{ID: "2", Title: "title2"},
|
|
}
|
|
|
|
data, err := compressObj(inData)
|
|
assert.NoError(t, err)
|
|
|
|
var outData []model.Item
|
|
err = decompressObj(data, &outData)
|
|
assert.NoError(t, err)
|
|
|
|
assert.ObjectsAreEqual(inData, outData)
|
|
}
|