mirror of
https://github.com/AthanorLabs/atomic-swap.git
synced 2026-04-22 03:00:02 -04:00
21 lines
387 B
Go
21 lines
387 B
Go
package common
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestReverse(t *testing.T) {
|
|
in := []byte{0xa, 0xb, 0xc}
|
|
expected := []byte{0xc, 0xb, 0xa}
|
|
res := Reverse(in)
|
|
require.Equal(t, expected, in)
|
|
require.Equal(t, expected, res)
|
|
|
|
in2 := [3]byte{0xa, 0xb, 0xc}
|
|
res = Reverse(in2[:])
|
|
require.Equal(t, expected, in2[:])
|
|
require.Equal(t, expected, res)
|
|
}
|