You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-algorithms/numerical/swap_test.go

20 lines
289 B
Go

package numerical
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSwap(t *testing.T) {
x := 5
y := 6
expectedX := 6
expectedY := 5
swap(&x, &y)
assert.Equal(t, x, expectedX, "value should be equal")
assert.Equal(t, y, expectedY, "value should be equal")
}