github.com/zmap/zlint@v1.1.0/lints/lint_qcstatem_qclimitvalue_valid_test.go (about)

     1  /*
     2   * ZLint Copyright 2018 Regents of the University of Michigan
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License"); you may not
     5   * use this file except in compliance with the License. You may obtain a copy
     6   * of the License at http://www.apache.org/licenses/LICENSE-2.0
     7   *
     8   * Unless required by applicable law or agreed to in writing, software
     9   * distributed under the License is distributed on an "AS IS" BASIS,
    10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
    11   * implied. See the License for the specific language governing
    12   * permissions and limitations under the License.
    13   */
    14  
    15  package lints
    16  
    17  import (
    18  	"testing"
    19  )
    20  
    21  func TestQcStatemQcLimitValueValid(t *testing.T) {
    22  	m := map[string]LintStatus{
    23  		"QcStmtValidLimitValue.pem": Pass,
    24  	}
    25  	for inputPath, expected := range m {
    26  		inputPath = "../testlint/testCerts/" + inputPath
    27  		out := Lints["e_qcstatem_qclimitvalue_valid"].Execute(ReadCertificate(inputPath))
    28  
    29  		if out.Status != expected {
    30  			t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status)
    31  		}
    32  	}
    33  }
    34  
    35  func TestQcStatemQcLimitValueInvalid(t *testing.T) {
    36  	m := map[string]LintStatus{
    37  		"QcStmtInvalidLimitValue.pem": Error,
    38  	}
    39  	for inputPath, expected := range m {
    40  		inputPath = "../testlint/testCerts/" + inputPath
    41  		out := Lints["e_qcstatem_qclimitvalue_valid"].Execute(ReadCertificate(inputPath))
    42  
    43  		if out.Status != expected {
    44  			t.Errorf("%s: expected %s, got %s", inputPath, expected, out.Status)
    45  		}
    46  	}
    47  }