-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrepresentation_test.go
55 lines (53 loc) · 1.17 KB
/
representation_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package dash
import (
"os"
"testing"
)
func TestRepresentation(t *testing.T) {
t.Run("itv", func(t *testing.T) {
data, err := os.ReadFile("testdata/itv.mpd")
if err != nil {
t.Fatal(err)
}
var media Mpd
err = media.Unmarshal(data)
if err != nil {
t.Fatal(err)
}
var represent Representation
for represent = range media.Representation() {
break
}
for segment := range represent.Segment() {
if segment >= 1 {
break
}
}
})
t.Run("pluto", func(t *testing.T) {
data, err := os.ReadFile("testdata/pluto.mpd")
if err != nil {
t.Fatal(err)
}
var media Mpd
err = media.Unmarshal(data)
if err != nil {
t.Fatal(err)
}
var represent Representation
for represent = range media.Representation() {
data := represent.String()
if data == "" {
t.Fatal(represent)
}
}
for range represent.Representation() {
break
}
for segment := range represent.Segment() {
if segment >= 9 {
break
}
}
})
}