Commit 53ec0e5e authored by pfandzelter's avatar pfandzelter
Browse files

add test for vector stuff

parent 4724b3ea
Pipeline #69951 failed with stages
in 23 minutes and 54 seconds
package vector
import (
"testing"
"github.com/DistributedClocks/GoVector/govec/vclock"
"github.com/stretchr/testify/assert"
)
func TestBytes(t *testing.T) {
v := vclock.New()
v["A"] = 1
v["B"] = 40
v["C"] = 0
v["D"] = 10
c, err := FromBytes(Bytes(v))
assert.NoError(t, err)
assert.True(t, v.Compare(c, vclock.Equal))
}
package vector
import (
"testing"
"github.com/DistributedClocks/GoVector/govec/vclock"
"github.com/stretchr/testify/assert"
)
func TestSortedVCString(t *testing.T) {
v := vclock.New()
v["A"] = 1
v["B"] = 40
v["C"] = 0
v["D"] = 10
assert.Equal(t, "{\"A\":1, \"B\":40, \"C\":0, \"D\":10}", SortedVCString(v))
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment