github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/model/permission_test.go (about)

     1  // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
     2  // See LICENSE.txt for license information.
     3  
     4  package model
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  // This is a test to ensure that we don't accidentally add more permissions than can fit
    13  // in the database column for role permissions.
    14  func TestPermissionsLength(t *testing.T) {
    15  	permissionsString := ""
    16  	for _, permission := range ALL_PERMISSIONS {
    17  		permissionsString += " " + permission.Id
    18  	}
    19  
    20  	assert.True(t, len(permissionsString) < 4096)
    21  }