diff options
Diffstat (limited to 'pkg/sif/descriptor_input_test.go')
-rw-r--r-- | pkg/sif/descriptor_input_test.go | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pkg/sif/descriptor_input_test.go b/pkg/sif/descriptor_input_test.go index 8431231..5c34099 100644 --- a/pkg/sif/descriptor_input_test.go +++ b/pkg/sif/descriptor_input_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021, Sylabs Inc. All rights reserved. +// Copyright (c) 2021-2022, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE file distributed with the sources of this project regarding your // rights to use or distribute this software. @@ -163,6 +163,21 @@ func TestNewDescriptorInput(t *testing.T) { OptSignatureMetadata(crypto.SHA256, fp), }, }, + { + name: "OptSBOMMetadataUnexpectedDataType", + t: DataGeneric, + opts: []DescriptorInputOpt{ + OptSBOMMetadata(SBOMFormatCycloneDXJSON), + }, + wantErr: &unexpectedDataTypeError{DataGeneric, []DataType{DataSBOM}}, + }, + { + name: "OptSBOMMetadata", + t: DataSBOM, + opts: []DescriptorInputOpt{ + OptSBOMMetadata(SBOMFormatCycloneDXJSON), + }, + }, } for _, tt := range tests { tt := tt |