go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/_motor/providers/provider_test.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package providers
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  )
    11  
    12  func TestToPlatformIdDetectors(t *testing.T) {
    13  	t.Run("aliases", func(t *testing.T) {
    14  		assert.ElementsMatch(
    15  			t,
    16  			[]PlatformIdDetector{AWSEc2Detector, HostnameDetector},
    17  			ToPlatformIdDetectors([]string{"awsec2", "hostname"}))
    18  
    19  		assert.ElementsMatch(
    20  			t,
    21  			[]PlatformIdDetector{AWSEc2Detector, HostnameDetector},
    22  			ToPlatformIdDetectors([]string{"aws-ec2", "hostname"}))
    23  	})
    24  }