Skip to content

Commit

Permalink
types: add text interfaces tests
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlettman committed Jul 16, 2024
1 parent 9ec7ed6 commit d42a947
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/auto-start-flag_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package types

import (
"encoding"
"github.com/brianvoe/gofakeit/v7"
"github.com/stretchr/testify/assert"
"testing"
)

func TestAutoStartFlag_TextInterfaces(t *testing.T) {
assert.Implements(t, (*encoding.TextMarshaler)(nil), new(AutoStartFlag))
assert.Implements(t, (*encoding.TextUnmarshaler)(nil), new(AutoStartFlag))
}

func TestAutoStartFlag_String(t *testing.T) {
type TestCase struct {
a AutoStartFlag
Expand Down
6 changes: 6 additions & 0 deletions types/full-scale-range_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package types

import (
"encoding"
"github.com/brianvoe/gofakeit/v7"
"github.com/stretchr/testify/assert"
"testing"
)

func TestFullScaleRange_TextInterfaces(t *testing.T) {
assert.Implements(t, (*encoding.TextMarshaler)(nil), new(FullScaleRange))
assert.Implements(t, (*encoding.TextUnmarshaler)(nil), new(FullScaleRange))
}

func TestFullScaleRange_String(t *testing.T) {
type TestCase struct {
name string
Expand Down
6 changes: 6 additions & 0 deletions types/lidar-mode_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
package types

import (
"encoding"
"github.com/brianvoe/gofakeit/v7"
"github.com/stretchr/testify/assert"
"testing"
)

func TestLIDARMode_TextInterfaces(t *testing.T) {
assert.Implements(t, (*encoding.TextMarshaler)(nil), new(LIDARMode))
assert.Implements(t, (*encoding.TextUnmarshaler)(nil), new(LIDARMode))
}

func TestLIDARMode_String(t *testing.T) {
type TestCase struct {
name string
Expand Down
6 changes: 6 additions & 0 deletions types/multipurpose-io-mode_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package types

import (
"encoding"
"github.com/brianvoe/gofakeit/v7"
"github.com/stretchr/testify/assert"
"math"
"testing"
)

func TestMultipurposeIOMode_TextInterfaces(t *testing.T) {
assert.Implements(t, (*encoding.TextMarshaler)(nil), new(MultipurposeIOMode))
assert.Implements(t, (*encoding.TextUnmarshaler)(nil), new(MultipurposeIOMode))
}

func TestMultipurposeIOMode_String(t *testing.T) {
type TestCase struct {
name string
Expand Down

0 comments on commit d42a947

Please sign in to comment.