devicepath/ipv4_test.go

19 lines
411 B
Go
Raw Permalink Normal View History

2023-09-18 11:47:44 +00:00
package devicepath_test
import (
"testing"
"git.faercol.me/faercol/devicepath"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestParseIpv4String(t *testing.T) {
t.Run("OK", func(t *testing.T) {
expected := "IPv4(0.0.0.00.0.0.0,0,0)"
var dev devicepath.Ipv4DevicePath
require.NoError(t, dev.ParseString(expected))
assert.Equal(t, expected, dev.String())
})
}