go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/utils/stringx/dedup_test.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package stringx_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/stretchr/testify/assert"
    10  	"go.mondoo.com/cnquery/utils/stringx"
    11  )
    12  
    13  func TestDedupStringArray(t *testing.T) {
    14  	arr := []string{"a", "a", "b", "b", "c"}
    15  	assert.ElementsMatch(t, []string{"a", "b", "c"}, stringx.DedupStringArray(arr))
    16  }