github.com/CycloneDX/sbom-utility@v0.16.0/cmd/validate_spdx_examples_test.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  /*
     3   * Licensed to the Apache Software Foundation (ASF) under one or more
     4   * contributor license agreements.  See the NOTICE file distributed with
     5   * this work for additional information regarding copyright ownership.
     6   * The ASF licenses this file to You under the Apache License, Version 2.0
     7   * (the "License"); you may not use this file except in compliance with
     8   * the License.  You may obtain a copy of the License at
     9   *
    10   *     http://www.apache.org/licenses/LICENSE-2.0
    11   *
    12   * Unless required by applicable law or agreed to in writing, software
    13   * distributed under the License is distributed on an "AS IS" BASIS,
    14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15   * See the License for the specific language governing permissions and
    16   * limitations under the License.
    17   */
    18  
    19  package cmd
    20  
    21  import "testing"
    22  
    23  const (
    24  	// SPDX - Examples
    25  	TEST_SPDX_2_2_EXAMPLE_1     = "examples/spdx/example1/example1.json"
    26  	TEST_SPDX_2_2_EXAMPLE_2_BIN = "examples/spdx/example2/example2-bin.json"
    27  	TEST_SPDX_2_2_EXAMPLE_2_SRC = "examples/spdx/example2/example2-src.json"
    28  	TEST_SPDX_2_2_EXAMPLE_5_BIN = "examples/spdx/example5/example5-bin.json"
    29  	TEST_SPDX_2_2_EXAMPLE_5_SRC = "examples/spdx/example5/example5-src.json"
    30  	TEST_SPDX_2_2_EXAMPLE_6_LIB = "examples/spdx/example6/example6-lib.json"
    31  	TEST_SPDX_2_2_EXAMPLE_6_SRC = "examples/spdx/example6/example6-src.json"
    32  )
    33  
    34  // SPDX - Examples
    35  func TestValidateSpdx22Example1(t *testing.T) {
    36  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_1)
    37  	innerTestValidate(t, *vti)
    38  }
    39  
    40  func TestValidateSpdx22Example2Bin(t *testing.T) {
    41  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_2_BIN)
    42  	innerTestValidate(t, *vti)
    43  }
    44  
    45  func TestValidateSpdx22Example2Src(t *testing.T) {
    46  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_2_SRC)
    47  	innerTestValidate(t, *vti)
    48  }
    49  
    50  func TestValidateSpdx22Example5Bin(t *testing.T) {
    51  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_5_BIN)
    52  	innerTestValidate(t, *vti)
    53  }
    54  
    55  func TestValidateSpdx22Example5Src(t *testing.T) {
    56  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_5_SRC)
    57  	innerTestValidate(t, *vti)
    58  }
    59  
    60  func TestValidateSpdx22Example6Lib(t *testing.T) {
    61  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_6_LIB)
    62  	innerTestValidate(t, *vti)
    63  }
    64  
    65  func TestValidateSpdx22Example6Src(t *testing.T) {
    66  	vti := NewValidateTestInfoMinimum(TEST_SPDX_2_2_EXAMPLE_6_SRC)
    67  	innerTestValidate(t, *vti)
    68  }