go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/explorer/scan/local_scanner_test.go (about) 1 // Copyright (c) Mondoo, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package scan 5 6 import ( 7 "testing" 8 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestFilterPreprocess(t *testing.T) { 13 // given 14 filters := []string{ 15 "namespace1/pack1", 16 "namespace2/pack2", 17 "//registry.mondoo.com/namespace/namespace3/querypacks/pack3", 18 } 19 20 // when 21 preprocessed := preprocessQueryPackFilters(filters) 22 23 // then 24 assert.Equal(t, []string{ 25 "//registry.mondoo.com/namespace/namespace1/querypacks/pack1", 26 "//registry.mondoo.com/namespace/namespace2/querypacks/pack2", 27 "//registry.mondoo.com/namespace/namespace3/querypacks/pack3", 28 }, preprocessed) 29 }