github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/builder/remotecontext/mimetype_test.go (about)

     1  package remotecontext // import "github.com/Prakhar-Agarwal-byte/moby/builder/remotecontext"
     2  
     3  import (
     4  	"testing"
     5  
     6  	"gotest.tools/v3/assert"
     7  	is "gotest.tools/v3/assert/cmp"
     8  )
     9  
    10  func TestDetectContentType(t *testing.T) {
    11  	input := []byte("That is just a plain text")
    12  
    13  	contentType, err := detectContentType(input)
    14  	assert.NilError(t, err)
    15  	assert.Check(t, is.Equal(mimeTypeTextPlain, contentType))
    16  }