Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Conversation

andyborn
Copy link
Contributor

Hi @grafov have added encoding for Segment.Map to address #93

@coveralls
Copy link

coveralls commented Jun 27, 2017

Coverage Status

Coverage decreased (-4.3%) to 63.629% when pulling 2fe9fa7 on andyborn:master into d08b372 on grafov:master.

@bradleyfalzon
Copy link
Collaborator

bradleyfalzon commented Jun 27, 2017

Thanks, this looks good to me, would you be able to provide a unit test for it as well?

Also, it appears we're reading EXT-X-MAP on both playlist and segments, is that correct? There was only a problem in writing the tag per segment?

Edit: If you need a hand, let me know.

writer_test.go Outdated
@@ -313,6 +313,7 @@ func TestSetMapForMediaPlaylist(t *testing.T) {
if e != nil {
t.Errorf("Set map to a media playlist failed: %s", e)
}
// fmt.Println(p.Encode().String())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're able to write the relevant tests, can you remove this comment?

writer_test.go Outdated
@@ -566,7 +567,7 @@ func TestNewMasterPlaylistWithAlternatives(t *testing.T) {
if m.ver != 4 {
t.Fatalf("Expected version 4, actual, %d", m.ver)
}
fmt.Printf("%v\n", m)
// fmt.Printf("%v\n", m)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're able to write the relevant tests, can you remove this comment?

@coveralls
Copy link

coveralls commented Jun 28, 2017

Coverage Status

Coverage increased (+1.6%) to 69.561% when pulling 72d4771 on andyborn:master into d08b372 on grafov:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+1.6%) to 69.561% when pulling 72d4771 on andyborn:master into d08b372 on grafov:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+1.6%) to 69.561% when pulling 72d4771 on andyborn:master into d08b372 on grafov:master.

Copy link
Collaborator

@bradleyfalzon bradleyfalzon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm jumping the gun a bit here, but just saw you pushed some more commits.

This looks really good, appreciate the tests, extra coverage and updating of docs.

I noticed you didn't use raw string literals, they make the expected line a little easier to read, I'd suggest we swap them around (I've highlighted 2 cases but there's a few more) - I'll leave it to you to decide whether this was intentional or not and up to you if you want to leave it.

Let me know when you're ready and I'll merge.

writer_test.go Outdated
}
p.SetDefaultMap("https://example.com", 1000*1024, 1024*1024)

expected := "EXT-X-MAP:URI=\"https://example.com\",BYTERANGE=1024000@1048576"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can rewrite with backticks so you don't need to escape the quotes, eg

expected := `#EXT-X-MAP:URI="https://example.com",BYTERANGE=1024000@1048576`

writer_test.go Outdated
@@ -313,6 +328,43 @@ func TestSetMapForMediaPlaylist(t *testing.T) {
if e != nil {
t.Errorf("Set map to a media playlist failed: %s", e)
}

expected := "EXT-X-MAP:URI=\"https://example.com\",BYTERANGE=1024000@1048576\n#EXTINF:5.000,\ntest01.ts"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively:

expected := `EXT-X-MAP:URI="https://example.com",BYTERANGE=1024000@1048576
#EXTINF:5.000,
test01.ts`

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, have updated test expectations to string literals where possible. hopefully good to merge now.

@coveralls
Copy link

coveralls commented Jun 28, 2017

Coverage Status

Coverage increased (+1.6%) to 69.561% when pulling 1be86df on andyborn:master into d08b372 on grafov:master.

@coveralls
Copy link

coveralls commented Jun 28, 2017

Coverage Status

Coverage increased (+1.6%) to 69.561% when pulling 8f8e946 on andyborn:master into d08b372 on grafov:master.

@bradleyfalzon bradleyfalzon merged commit e911eb7 into grafov:master Jun 28, 2017
@bradleyfalzon
Copy link
Collaborator

Thanks for the contribution Andy and the additional tests. Much appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants