untangledco / streaming

Media streaming and broadcast systems in Go
https://twitch.tv/untangledco
ISC License
82 stars 5 forks source link

modify tests #30

Closed swills closed 1 month ago

ollytom commented 1 month ago

Thanks! Comments inline below...

diff --git a/sdp/parser.go b/sdp/parser.go index b00a407..90dd63f 100644 --- a/sdp/parser.go +++ b/sdp/parser.go @@ -2,6 +2,7 @@ package sdp import ( "bufio"

  • "errors" "fmt" "net/url" "strconv" @@ -233,11 +234,6 @@ type Repeat struct { } func parseRepeat(s string) (Repeat, error) {
  • // guard against negative durations, decimals.
  • // these are valid for time.ParseDuration, but not for our Repeat.
  • if i := strings.IndexAny(s, "-."); i > 0 {
  • return Repeat{}, fmt.Errorf("illegal character %c", s[i])
  • }

Can we put this back? Negative durations are valid, including in SDP (in time zone offsets).

  • {
  • name: "nice",
  • s: "69s",
  • want: 69 * time.Second,
  • },

lol

  • {
  • name: "negative",
  • s: "-01s",
  • want: 0,
  • wantErr: true,
  • },

Won't need this test as negative durations are valid

Everything else is so much better! Awesome! Much nicer, thank you!!!! Guess I owe a patch for serena now ;)

ollytom commented 1 month ago

Thanks! Applied as 57fae4fd068fd5