File: common_test.go

package info (click to toggle)
golang-github-etherlabsio-go-m3u8 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 348 kB
  • sloc: makefile: 3
file content (18 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package test

import (
	"testing"

	"github.com/etherlabsio/go-m3u8/m3u8"
	"github.com/stretchr/testify/assert"
)

func TestParseAttributes(t *testing.T) {
	line := "TEST-ID=\"Help\",URI=\"http://test\",ID=33\n"
	mapAttr := m3u8.ParseAttributes(line)

	assert.NotNil(t, mapAttr)
	assert.Equal(t, "Help", mapAttr["TEST-ID"])
	assert.Equal(t, "http://test", mapAttr["URI"])
	assert.Equal(t, "33", mapAttr["ID"])
}