devicepath/pci_test.go
Melora Hugues 54794b57a4
All checks were successful
continuous-integration/drone/push Build is passing
add beginning of parser
2023-08-27 15:09:30 +02:00

22 lines
492 B
Go

package devicepath_test
import (
"testing"
devicepath "git.faercol.me/faercol/device-path"
"github.com/stretchr/testify/assert"
)
func TestToString(t *testing.T) {
t.Run("Only digits", func(t *testing.T) {
expected := "Pci(0x0,0x1)"
dev := devicepath.NewPCIDevicePath(0, 1)
assert.Equal(t, expected, dev.String())
})
t.Run("Letters", func(t *testing.T) {
expected := "Pci(0x2,0xa)"
dev := devicepath.NewPCIDevicePath(2, 10)
assert.Equal(t, expected, dev.String())
})
}