github.com/aquasecurity/trivy-iac@v0.8.1-0.20240127024015-3d8e412cf0ab/pkg/scanners/azure/functions/not_test.go (about) 1 package functions 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 ) 8 9 func Test_Not(t *testing.T) { 10 tests := []struct { 11 name string 12 args []interface{} 13 expected bool 14 }{ 15 { 16 name: "Not with true", 17 args: []interface{}{true}, 18 expected: false, 19 }, 20 { 21 name: "Not with false", 22 args: []interface{}{false}, 23 expected: true, 24 }, 25 } 26 27 for _, tt := range tests { 28 t.Run(tt.name, func(t *testing.T) { 29 got := Not(tt.args...) 30 assert.Equal(t, tt.expected, got) 31 }) 32 } 33 }