github.com/TeaOSLab/EdgeNode@v1.3.8/internal/utils/common_files_test.go (about)

     1  // Copyright 2024 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
     2  
     3  package utils_test
     4  
     5  import (
     6  	"github.com/TeaOSLab/EdgeNode/internal/utils"
     7  	"github.com/iwind/TeaGo/assert"
     8  	"testing"
     9  )
    10  
    11  func TestIsCommonFileExtension(t *testing.T) {
    12  	var a = assert.NewAssertion(t)
    13  
    14  	a.IsTrue(utils.IsCommonFileExtension(".jpg"))
    15  	a.IsTrue(utils.IsCommonFileExtension("png"))
    16  	a.IsTrue(utils.IsCommonFileExtension("PNG"))
    17  	a.IsTrue(utils.IsCommonFileExtension(".PNG"))
    18  	a.IsTrue(utils.IsCommonFileExtension("Png"))
    19  	a.IsFalse(utils.IsCommonFileExtension("zip"))
    20  }