github.com/kotovmak/go-admin@v1.1.1/plugins/admin/modules/helper_test.go (about)

     1  package modules
     2  
     3  import (
     4  	"regexp"
     5  	"testing"
     6  
     7  	"github.com/magiconair/properties/assert"
     8  )
     9  
    10  func TestInArray(t *testing.T) {
    11  	assert.Equal(t, isFormURL("/admin/info/profile/new"), true)
    12  }
    13  
    14  func isFormURL(s string) bool {
    15  	reg, _ := regexp.Compile("(.*?)info/(.*)/(new|edit)(.*?)")
    16  	return reg.MatchString(s)
    17  }