commit 7d3701c071389c1c8b805d6e2b2585bacbe9ce59
parent 9787ba1ad2c23ae5095f8a61854daec5b1fc42eb
Author: Oliver Lowe <o@olowe.co>
Date: Tue, 30 Apr 2024 22:40:01 +1000
internal/scte35: remove more uses of testify
The dependency saved only a couple of lines.
Diffstat:
2 files changed, 16 insertions(+), 28 deletions(-)
diff --git a/internal/scte35/segmentation_upid_test.go b/internal/scte35/segmentation_upid_test.go
@@ -1,29 +1,11 @@
-package scte35_test
+package scte35
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
- "github.com/untangledco/streaming/internal/scte35"
-)
+import "testing"
func TestSegmentationUPID_ASCIIValue(t *testing.T) {
- cases := map[string]struct {
- upid scte35.SegmentationUPID
- expected string
- }{
- "Simple": {
- upid: scte35.SegmentationUPID{
- Type: 0x09,
- Value: "SIGNAL:z1sFOMjCnV4AAAAAAAABAQ==",
- },
- expected: "SIGNAL:z1sFOMjCnV4AAAAAAAABAQ==",
- },
- }
-
- for k, c := range cases {
- t.Run(k, func(t *testing.T) {
- require.Equal(t, c.expected, c.upid.ASCIIValue())
- })
+ upid := SegmentationUPID{Type: 0x09, Value: "SIGNAL:z1sFOMjCnV4AAAAAAAABAQ=="}
+ want := "SIGNAL:z1sFOMjCnV4AAAAAAAABAQ=="
+ if want != upid.ASCIIValue() {
+ t.Errorf("want %s, got %s", want, upid.ASCIIValue())
}
}
diff --git a/internal/scte35/splice_info_section_test.go b/internal/scte35/splice_info_section_test.go
@@ -7,8 +7,6 @@ import (
"path"
"strings"
"testing"
-
- "github.com/stretchr/testify/require"
)
type sistest struct {
@@ -68,12 +66,20 @@ func TestSpliceInfoSection(t *testing.T) {
if err := json.Unmarshal(b, &got); err != nil {
t.Fatal(err)
}
- require.Equal(t, toJSON(&tt.sis), toJSON(&got))
+ if toJSON(&tt.sis) != toJSON(&got) {
+ t.Error("remarshalled json different from source")
+ t.Logf("want: %s", toJSON(&tt.sis))
+ t.Logf("got: %s", toJSON(&got))
+ }
} else {
if err := xml.Unmarshal(b, &got); err != nil {
t.Fatal(err)
}
- require.Equal(t, toXML(&tt.sis), toXML(&got))
+ if toXML(&tt.sis) != toXML(&got) {
+ t.Error("remarshalled xml different from source")
+ t.Logf("want: %s", toXML(&tt.sis))
+ t.Logf("got: %s", toXML(&got))
+ }
}
})
}