1// SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later 2 3package spdxlib 4 5import ( 6 "reflect" 7 "testing" 8 9 "github.com/spdx/tools-golang/spdx/common" 10) 11 12func TestSortElementIDs(t *testing.T) { 13 eIDs := []common.ElementID{"def", "abc", "123"} 14 eIDs = SortElementIDs(eIDs) 15 16 if !reflect.DeepEqual(eIDs, []common.ElementID{"123", "abc", "def"}) { 17 t.Fatalf("expected sorted ElementIDs, got: %v", eIDs) 18 } 19} 20