commit 00a48be87c264d3c0182efd16ee0ec04195b260e
parent e5e0b3ba7bd6e3fcf66815ddf2a646bddd91ed69
Author: Oliver Lowe <o@olowe.co>
Date: Mon, 13 May 2024 08:55:48 +1000
internal/scte35: more consistent test diff output
Modeled after diff(1). Seems clear enough
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/internal/scte35/splice_info_test.go b/internal/scte35/splice_info_test.go
@@ -23,7 +23,8 @@ func diffInfo(a, b SpliceInfo) string {
fmt.Fprintf(buf, "SAP type = %s, %s\n", a.SAPType, b.SAPType)
}
if a.Cipher != b.Cipher {
- fmt.Fprintln(buf, "cipher = ", a.Cipher, b.Cipher)
+ fmt.Fprintln(buf, "cipher differs")
+ fmt.Fprintf(buf, "< %s\n> %s", a.Cipher, b.Cipher)
}
if a.PTSAdjustment != b.PTSAdjustment {
fmt.Fprintln(buf, "pts adjustment = ", a.PTSAdjustment, b.PTSAdjustment)
@@ -130,8 +131,8 @@ func TestEncodeSpliceInfo(t *testing.T) {
}
if tt.encoded != got {
t.Errorf("expected encoded splice info differs from calculated")
- t.Logf("< %v", bwant)
- t.Logf("> %v", b)
+ t.Logf("< %#x", bwant)
+ t.Logf("> %#x", b)
}
})
}