Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
package model
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAssertNotSameMap(t *testing.T) {
|
|
t.Run("both nil maps are the same", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
var a, b map[string]int
|
|
|
|
AssertNotSameMap(mockT, a, b)
|
|
require.True(t, mockT.Failed())
|
|
})
|
|
|
|
t.Run("one nil map is not the same", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
var a map[string]int
|
|
b := map[string]int{"key1": 1}
|
|
|
|
AssertNotSameMap(mockT, a, b)
|
|
require.False(t, mockT.Failed())
|
|
})
|
|
|
|
t.Run("different maps should not be the same", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
a := map[string]int{"key1": 1}
|
|
b := map[string]int{"key1": 1}
|
|
|
|
AssertNotSameMap(mockT, a, b)
|
|
require.False(t, mockT.Failed())
|
|
})
|
|
|
|
t.Run("same map should be the same", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
a := map[string]int{"key1": 1}
|
|
b := a
|
|
|
|
AssertNotSameMap(mockT, a, b)
|
|
require.True(t, mockT.Failed())
|
|
})
|
|
|
|
t.Run("same map should be the same after modification", func(t *testing.T) {
|
|
mockT := &testing.T{}
|
|
a := map[string]int{"key1": 1}
|
|
b := a
|
|
b["key2"] = 2
|
|
|
|
AssertNotSameMap(mockT, a, b)
|
|
require.True(t, mockT.Failed())
|
|
})
|
|
}
|