Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hori-ryota committed Jul 5, 2016
1 parent fdfe4d4 commit b76ffc1
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,46 @@ func ExampleMediaPlaylist_String() {
// test01.ts
}

// Create new media playlist
// Add two segments to media playlist
// Print it
func ExampleMediaPlaylist_String_Winsize0() {
p, _ := NewMediaPlaylist(0, 2)
p.Append("test01.ts", 5.0, "")
p.Append("test02.ts", 6.0, "")
fmt.Printf("%s\n", p)
// Output:
// #EXTM3U
// #EXT-X-VERSION:3
// #EXT-X-MEDIA-SEQUENCE:0
// #EXT-X-TARGETDURATION:6
// #EXTINF:5.000,
// test01.ts
// #EXTINF:6.000,
// test02.ts
}

// Create new media playlist
// Add two segments to media playlist
// Print it
func ExampleMediaPlaylist_String_Winsize0_VOD() {
p, _ := NewMediaPlaylist(0, 2)
p.Append("test01.ts", 5.0, "")
p.Append("test02.ts", 6.0, "")
p.Close()
fmt.Printf("%s\n", p)
// Output:
// #EXTM3U
// #EXT-X-VERSION:3
// #EXT-X-MEDIA-SEQUENCE:0
// #EXT-X-TARGETDURATION:6
// #EXTINF:5.000,
// test01.ts
// #EXTINF:6.000,
// test02.ts
// #EXT-X-ENDLIST
}

// Create new master playlist
// Add media playlist
// Encode structures to HLS
Expand Down

0 comments on commit b76ffc1

Please sign in to comment.