command_test.go (486B)
1 package scte35 2 3 import ( 4 "bytes" 5 "testing" 6 ) 7 8 func TestEncodeInsert(t *testing.T) { 9 out := &Insert{ 10 ID: 12345, 11 idCompliance: true, 12 OutOfNetwork: true, 13 Immediate: true, 14 Duration: &BreakDuration{true, uint64(90000 * 2)}, 15 } 16 in := &Insert{ 17 ID: out.ID, 18 idCompliance: true, 19 } 20 21 bout := encodeInsert(out) 22 bin := encodeInsert(in) 23 if bytes.Equal(bout, bin) { 24 t.Errorf("different inserts are equal when encoded") 25 t.Log(bout) 26 t.Log(bin) 27 } 28 }