cri-o/vendor/github.com/emicklei/go-restful/mime_test.go
Jacek J. Łakis bf51655a7b vendor: Update vendoring for the exec client and server implementations
Signed-off-by: Jacek J. Łakis <jacek.lakis@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2017-04-24 18:38:41 +02:00

17 lines
433 B
Go

package restful
import (
"fmt"
"testing"
)
// go test -v -test.run TestSortMimes ...restful
func TestSortMimes(t *testing.T) {
accept := "text/html; q=0.8, text/plain, image/gif, */*; q=0.01, image/jpeg"
result := sortedMimes(accept)
got := fmt.Sprintf("%v", result)
want := "[{text/plain 1} {image/gif 1} {image/jpeg 1} {text/html 0.8} {*/* 0.01}]"
if got != want {
t.Errorf("bad sort order of mime types:%s", got)
}
}