Skip to content

Commit

Permalink
Enable JSON output from Trim(), Query() to be indented using a user-s…
Browse files Browse the repository at this point in the history
…upplied number of space characters (#66)

* Allow Trim() JSON output to format using a user-supplied number of space chars.

Signed-off-by: Matt Rutkowski <[email protected]>

* Support --indent flag on Query() command

Signed-off-by: Matt Rutkowski <[email protected]>

* Support --indent flag on Query() command

Signed-off-by: Matt Rutkowski <[email protected]>

* Document the --indent flag

Signed-off-by: Matt Rutkowski <[email protected]>

* Add more Trim validation tests

Signed-off-by: Matt Rutkowski <[email protected]>

* Enable Query() testing for common function that buffers/writes temp output

Signed-off-by: Matt Rutkowski <[email protected]>

* Add Query() test that outputs to a temp. file

Signed-off-by: Matt Rutkowski <[email protected]>

* Use new standardized JSON writer/encoder for all commands that suppor --format json

Signed-off-by: Matt Rutkowski <[email protected]>

* Fix test initialization for new indent flag

Signed-off-by: Matt Rutkowski <[email protected]>

* Simplify vuln. test initialization options

Signed-off-by: Matt Rutkowski <[email protected]>

* Simplify resource test initialization options

Signed-off-by: Matt Rutkowski <[email protected]>

* Simplify trace logging using new JSON encoder methods

Signed-off-by: Matt Rutkowski <[email protected]>

* Simplify trace logging using new JSON encoder methods

Signed-off-by: Matt Rutkowski <[email protected]>

* change help references from SBOM to just BOM

Signed-off-by: Matt Rutkowski <[email protected]>

* change help references from SBOM to just BOM

Signed-off-by: Matt Rutkowski <[email protected]>

* Cleanup comments

Signed-off-by: Matt Rutkowski <[email protected]>

* small help changes for trim

Signed-off-by: Matt Rutkowski <[email protected]>

* Cleanup comments

Signed-off-by: Matt Rutkowski <[email protected]>

---------

Signed-off-by: Matt Rutkowski <[email protected]>
  • Loading branch information
mrutkows authored Nov 27, 2023
1 parent e421ef1 commit aa13384
Show file tree
Hide file tree
Showing 31 changed files with 599 additions and 431 deletions.
101 changes: 65 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,77 @@ which returns `0` (zero) or "no error":

### Persistent flags

This section describes some of the important command line flags that apply to most commands that have a `list` subcommand for generating columnar, report-styled output (e.g., `schema`, `license`, `vulnerability`, etc.).
This section describes some of the important command line flags that apply to most of the utility's commands.

- [format flag](#format-flag): with `--format`
- [indent flag](#indent-flag): with `--indent`
- [input flag](#input-flag): with `--input` or `-i`
- [output flag](#output-flag): with `--output` or `-o`
- [format flag](#format-flag): with `--format`
- [quiet flag](#quiet-flag): with `--quiet` or `-q`
- [where flag](#where-flag-output-filtering): with `--where`

**Note**: The `validate` command does not have a `list` subcommand and ignores the `format` and `where` flags.
#### Format flag

All `list` subcommands support the `--format` flag with the following values:

- `txt`: text (tabbed tables)
- `csv`: Comma Separated Value (CSV), e.g., for spreadsheets
- `md`: Markdown, e.g., for GitHub

Some commands, which can output lists of JSON objects, also support JSON format using the `json` value.

##### Example: `--format` flag

This example uses the `--format` flag on the `schema` command to output in markdown:

```bash
./sbom-utility schema --format md -q
```

```md
|name|format|version|variant|file (local)|url (remote)|
|:--|:--|:--|:--|:--|:--|
|CycloneDX v1.5|CycloneDX|1.5|(latest)|schema/cyclonedx/1.5/bom-1.5.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.5.schema.json|
|CycloneDX v1.4|CycloneDX|1.4|(latest)|schema/cyclonedx/1.4/bom-1.4.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.4.schema.json|
|CycloneDX/specification/master/schema/bom-1.3-strict.schema.json|
|CycloneDX v1.3|CycloneDX|1.3|(latest)|schema/cyclonedx/1.3/bom-1.3.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.3.schema.json|
|CycloneDX/specification/master/schema/bom-1.2-strict.schema.json|
|CycloneDX v1.2|CycloneDX|1.2|(latest)|schema/cyclonedx/1.2/bom-1.2.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.2.schema.json|
|SPDX v2.3.1 (development)|SPDX|SPDX-2.3|development|schema/spdx/2.3.1/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/development/v2.3.1/schemas/spdx-schema.json|
|SPDX v2.3|SPDX|SPDX-2.3|(latest)|schema/spdx/2.3/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/development/v2.3/schemas/spdx-schema.json|
|SPDX v2.2.2|SPDX|SPDX-2.2|(latest)|schema/spdx/2.2.2/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.2/schemas/spdx-schema.json|
|SPDX v2.2.1|SPDX|SPDX-2.2|2.2.1|schema/spdx/2.2.1/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json|
```

### Indent flag

This flag supplies an integer to any command that encodes JSON output to determine how many spaces to indent nested JSON elements. If not specified, the default indent is `4` (spaces).

#### Example: indent flag on the query command

```bash
./sbom-utility query --select name,version --from metadata.component -i examples/cyclonedx/SBOM/juice-shop-11.1.2/bom.json --indent 2 --quiet
```

output with `indent 2`:
```
{
"name": "juice-shop",
"version": "11.1.2"
}
```

```bash
./sbom-utility query --select name,version --from metadata.component -i examples/cyclonedx/SBOM/juice-shop-11.1.2/bom.json --indent 6 --quiet
```

output with `indent 6`:
```
{
"name": "juice-shop",
"version": "11.1.2"
}
```

#### Input flag

Expand Down Expand Up @@ -217,39 +279,6 @@ SPDX v2.2.1,SPDX,SPDX-2.2,2.2.1,schema/spdx/2.2.1/spdx-schema.json,https://raw.g

- **Note**: You can verify that `output.csv` loads within a spreadsheet app like MS Excel.

#### Format flag

All `list` subcommands support the `--format` flag with the following values:

- `txt`: text (tabbed tables)
- `csv`: Comma Separated Value (CSV), e.g., for spreadsheets
- `md`: Markdown, e.g., for GitHub

Some commands, which can output lists of JSON objects, also support JSON format using the `json` value.

##### Example: `--format` flag

This example uses the `--format` flag on the `schema` command to output in markdown:

```bash
./sbom-utility schema --format md -q
```

```md
|name|format|version|variant|file (local)|url (remote)|
|:--|:--|:--|:--|:--|:--|
|CycloneDX v1.5|CycloneDX|1.5|(latest)|schema/cyclonedx/1.5/bom-1.5.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.5.schema.json|
|CycloneDX v1.4|CycloneDX|1.4|(latest)|schema/cyclonedx/1.4/bom-1.4.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.4.schema.json|
|CycloneDX/specification/master/schema/bom-1.3-strict.schema.json|
|CycloneDX v1.3|CycloneDX|1.3|(latest)|schema/cyclonedx/1.3/bom-1.3.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.3.schema.json|
|CycloneDX/specification/master/schema/bom-1.2-strict.schema.json|
|CycloneDX v1.2|CycloneDX|1.2|(latest)|schema/cyclonedx/1.2/bom-1.2.schema.json|https://raw.githubusercontent.com/CycloneDX/specification/master/schema/bom-1.2.schema.json|
|SPDX v2.3.1 (development)|SPDX|SPDX-2.3|development|schema/spdx/2.3.1/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/development/v2.3.1/schemas/spdx-schema.json|
|SPDX v2.3|SPDX|SPDX-2.3|(latest)|schema/spdx/2.3/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/development/v2.3/schemas/spdx-schema.json|
|SPDX v2.2.2|SPDX|SPDX-2.2|(latest)|schema/spdx/2.2.2/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.2/schemas/spdx-schema.json|
|SPDX v2.2.1|SPDX|SPDX-2.2|2.2.1|schema/spdx/2.2.1/spdx-schema.json|https://raw.githubusercontent.com/spdx/spdx-spec/v2.2.1/schemas/spdx-schema.json|
```

#### Quiet flag

All commands support the `--quiet` flag. By default, the utility outputs informational (INFO), warning (WARNING) and error (ERROR) text along with the actual command results to `stdout`. If you wish to only see the command results (JSON) or report (tables) you can run any command in "quiet mode" by simply supplying the `--quiet` or its short-form `-q` flag.
Expand Down
4 changes: 2 additions & 2 deletions cmd/license.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const (
func NewCommandLicense() *cobra.Command {
var command = new(cobra.Command)
command.Use = "license"
command.Short = "Process licenses found in SBOM input file"
command.Long = "Process licenses found in SBOM input file"
command.Short = "Process licenses found in the BOM input file"
command.Long = "Process licenses found in the BOM input file"
command.RunE = licenseCmdImpl
command.ValidArgs = VALID_SUBCOMMANDS_LICENSE
command.PreRunE = func(cmd *cobra.Command, args []string) (err error) {
Expand Down
35 changes: 17 additions & 18 deletions cmd/license_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"text/tabwriter"

"github.com/CycloneDX/sbom-utility/common"
"github.com/CycloneDX/sbom-utility/log"
"github.com/CycloneDX/sbom-utility/schema"
"github.com/CycloneDX/sbom-utility/utils"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -266,7 +265,7 @@ func ListLicenses(writer io.Writer, policyConfig *schema.LicensePolicyConfig,
// NOTE: if no license are found, the "json.Marshal" method(s) will return a value of "null"
// which is valid JSON (and not an empty array)
// TODO: Support de-duplication (flag) (which MUST be exact using deep comparison)
func DisplayLicenseListJson(bom *schema.BOM, output io.Writer) {
func DisplayLicenseListJson(bom *schema.BOM, writer io.Writer) {
getLogger().Enter()
defer getLogger().Exit()

Expand All @@ -283,21 +282,21 @@ func DisplayLicenseListJson(bom *schema.BOM, output io.Writer) {
}
}
}
json, _ := log.FormatInterfaceAsJson(lc)

// Note: JSON data files MUST ends in a newline as this is a POSIX standard
fmt.Fprintf(output, "%s\n", json)
// which is already accounted for by the JSON encoder.
utils.WriteAnyAsEncodedJSONInt(writer, lc, utils.GlobalFlags.PersistentFlags.GetOutputIndentInt())
}

// NOTE: This list is NOT de-duplicated
func DisplayLicenseListCSV(bom *schema.BOM, output io.Writer) (err error) {
func DisplayLicenseListCSV(bom *schema.BOM, writer io.Writer) (err error) {
getLogger().Enter()
defer getLogger().Exit()

var licenseInfo schema.LicenseInfo
var currentRow []string

w := csv.NewWriter(output)
w := csv.NewWriter(writer)
defer w.Flush()

// Emit title row
Expand Down Expand Up @@ -343,19 +342,19 @@ func DisplayLicenseListCSV(bom *schema.BOM, output io.Writer) (err error) {
}

// NOTE: This list is NOT de-duplicated
func DisplayLicenseListMarkdown(bom *schema.BOM, output io.Writer) {
func DisplayLicenseListMarkdown(bom *schema.BOM, writer io.Writer) {
getLogger().Enter()
defer getLogger().Exit()

var licenseInfo schema.LicenseInfo

// create title row
titleRow := createMarkdownRow(LICENSE_LIST_TITLES_LICENSE_CHOICE)
fmt.Fprintf(output, "%s\n", titleRow)
fmt.Fprintf(writer, "%s\n", titleRow)

alignments := createMarkdownColumnAlignment(LICENSE_LIST_TITLES_LICENSE_CHOICE)
alignmentRow := createMarkdownRow(alignments)
fmt.Fprintf(output, "%s\n", alignmentRow)
fmt.Fprintf(writer, "%s\n", alignmentRow)

// Display a warning messing in the actual output and return (short-circuit)
licenseKeys := bom.LicenseMap.KeySet()
Expand Down Expand Up @@ -395,7 +394,7 @@ func DisplayLicenseListMarkdown(bom *schema.BOM, output io.Writer) {
content)

lineRow = createMarkdownRow(line)
fmt.Fprintf(output, "%s\n", lineRow)
fmt.Fprintf(writer, "%s\n", lineRow)
}

}
Expand All @@ -406,7 +405,7 @@ func DisplayLicenseListMarkdown(bom *schema.BOM, output io.Writer) {
// TODO: Make policy column optional
// TODO: Add a --no-title flag to skip title output
// TODO: Support a new --sort <column> flag
func DisplayLicenseListSummaryText(bom *schema.BOM, output io.Writer) {
func DisplayLicenseListSummaryText(bom *schema.BOM, writer io.Writer) {
getLogger().Enter()
defer getLogger().Exit()

Expand All @@ -415,7 +414,7 @@ func DisplayLicenseListSummaryText(bom *schema.BOM, output io.Writer) {
defer w.Flush()

// min-width, tab-width, padding, pad-char, flags
w.Init(output, 8, 2, 2, ' ', 0)
w.Init(writer, 8, 2, 2, ' ', 0)

var licenseInfo schema.LicenseInfo

Expand Down Expand Up @@ -458,12 +457,12 @@ func DisplayLicenseListSummaryText(bom *schema.BOM, output io.Writer) {
// TODO: Make policy column optional
// TODO: Add a --no-title flag to skip title output
// TODO: Support a new --sort <column> flag
func DisplayLicenseListSummaryCSV(bom *schema.BOM, output io.Writer) (err error) {
func DisplayLicenseListSummaryCSV(bom *schema.BOM, writer io.Writer) (err error) {
getLogger().Enter()
defer getLogger().Exit()

// initialize writer and prepare the list of entries (i.e., the "rows")
w := csv.NewWriter(output)
w := csv.NewWriter(writer)
defer w.Flush()

var currentRow []string
Expand Down Expand Up @@ -526,19 +525,19 @@ func DisplayLicenseListSummaryCSV(bom *schema.BOM, output io.Writer) (err error)
// TODO: Make policy column optional
// TODO: Add a --no-title flag to skip title output
// TODO: Support a new --sort <column> flag
func DisplayLicenseListSummaryMarkdown(bom *schema.BOM, output io.Writer) {
func DisplayLicenseListSummaryMarkdown(bom *schema.BOM, writer io.Writer) {
getLogger().Enter()
defer getLogger().Exit()

var licenseInfo schema.LicenseInfo

// create title row
titleRow := createMarkdownRow(LICENSE_SUMMARY_TITLES)
fmt.Fprintf(output, "%s\n", titleRow)
fmt.Fprintf(writer, "%s\n", titleRow)

alignments := createMarkdownColumnAlignment(LICENSE_SUMMARY_TITLES)
alignmentRow := createMarkdownRow(alignments)
fmt.Fprintf(output, "%s\n", alignmentRow)
fmt.Fprintf(writer, "%s\n", alignmentRow)

// Display a warning messing in the actual output and return (short-circuit)
licenseKeys := bom.LicenseMap.KeySet()
Expand Down Expand Up @@ -572,7 +571,7 @@ func DisplayLicenseListSummaryMarkdown(bom *schema.BOM, output io.Writer) {
)

lineRow = createMarkdownRow(line)
fmt.Fprintf(output, "%s\n", lineRow)
fmt.Fprintf(writer, "%s\n", lineRow)
}
}
}
20 changes: 10 additions & 10 deletions cmd/license_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func ListLicensePolicies(writer io.Writer, policyConfig *schema.LicensePolicyCon
// NOTE: assumes all entries in the policy config file MUST have family names
// TODO: Allow caller to pass flag to truncate or not (perhaps with value)
// TODO: Add a --no-title flag to skip title output
func DisplayLicensePoliciesTabbedText(output io.Writer, filteredPolicyMap *slicemultimap.MultiMap, flags utils.LicenseCommandFlags) (err error) {
func DisplayLicensePoliciesTabbedText(writer io.Writer, filteredPolicyMap *slicemultimap.MultiMap, flags utils.LicenseCommandFlags) (err error) {
getLogger().Enter()
defer getLogger().Exit()

Expand All @@ -254,7 +254,7 @@ func DisplayLicensePoliciesTabbedText(output io.Writer, filteredPolicyMap *slice
defer w.Flush()

// min-width, tab-width, padding, pad-char, flags
w.Init(output, 8, 2, 2, ' ', 0)
w.Init(writer, 8, 2, 2, ' ', 0)

// create title row and underline row from slices of optional and compulsory titles
titles, underlines := prepareReportTitleData(LICENSE_POLICY_LIST_ROW_DATA, flags.Summary)
Expand Down Expand Up @@ -330,12 +330,12 @@ func DisplayLicensePoliciesTabbedText(output io.Writer, filteredPolicyMap *slice
}

// TODO: Add a --no-title flag to skip title output
func DisplayLicensePoliciesCSV(output io.Writer, filteredPolicyMap *slicemultimap.MultiMap, flags utils.LicenseCommandFlags) (err error) {
func DisplayLicensePoliciesCSV(writer io.Writer, filteredPolicyMap *slicemultimap.MultiMap, flags utils.LicenseCommandFlags) (err error) {
getLogger().Enter()
defer getLogger().Exit()

// initialize writer and prepare the list of entries (i.e., the "rows")
w := csv.NewWriter(output)
w := csv.NewWriter(writer)
defer w.Flush()

// Create title row data as []string
Expand All @@ -351,7 +351,7 @@ func DisplayLicensePoliciesCSV(output io.Writer, filteredPolicyMap *slicemultima
// Emit no schemas found warning into output
// TODO Use only for Warning messages, do not emit in output table
if len(keyNames) == 0 {
fmt.Fprintf(output, "%s\n", MSG_OUTPUT_NO_POLICIES_FOUND)
fmt.Fprintf(writer, "%s\n", MSG_OUTPUT_NO_POLICIES_FOUND)
return fmt.Errorf(MSG_OUTPUT_NO_POLICIES_FOUND)
}

Expand Down Expand Up @@ -382,7 +382,7 @@ func DisplayLicensePoliciesCSV(output io.Writer, filteredPolicyMap *slicemultima
}

// TODO: Add a --no-title flag to skip title output
func DisplayLicensePoliciesMarkdown(output io.Writer, filteredPolicyMap *slicemultimap.MultiMap, flags utils.LicenseCommandFlags) (err error) {
func DisplayLicensePoliciesMarkdown(writer io.Writer, filteredPolicyMap *slicemultimap.MultiMap, flags utils.LicenseCommandFlags) (err error) {
getLogger().Enter()
defer getLogger().Exit()

Expand All @@ -391,11 +391,11 @@ func DisplayLicensePoliciesMarkdown(output io.Writer, filteredPolicyMap *slicemu

// create title row
titleRow := createMarkdownRow(titles)
fmt.Fprintf(output, "%s\n", titleRow)
fmt.Fprintf(writer, "%s\n", titleRow)

alignments := createMarkdownColumnAlignment(titles)
alignmentRow := createMarkdownRow(alignments)
fmt.Fprintf(output, "%s\n", alignmentRow)
fmt.Fprintf(writer, "%s\n", alignmentRow)

// Retrieve keys for policies to list
keyNames := filteredPolicyMap.KeySet()
Expand All @@ -404,7 +404,7 @@ func DisplayLicensePoliciesMarkdown(output io.Writer, filteredPolicyMap *slicemu
// Emit no schemas found warning into output
// TODO Use only for Warning messages, do not emit in output table
if len(keyNames) == 0 {
fmt.Fprintf(output, "%s\n", MSG_OUTPUT_NO_POLICIES_FOUND)
fmt.Fprintf(writer, "%s\n", MSG_OUTPUT_NO_POLICIES_FOUND)
return fmt.Errorf(MSG_OUTPUT_NO_POLICIES_FOUND)
}

Expand All @@ -428,7 +428,7 @@ func DisplayLicensePoliciesMarkdown(output io.Writer, filteredPolicyMap *slicemu
flags.Summary,
)
lineRow = createMarkdownRow(line)
fmt.Fprintf(output, "%s\n", lineRow)
fmt.Fprintf(writer, "%s\n", lineRow)
}
}
return
Expand Down
10 changes: 5 additions & 5 deletions cmd/license_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const (
// -------------------------------------------

func NewLicensePolicyTestInfoBasic(format string, listLineWrap bool) *LicenseTestInfo {
lti := NewLicenseTestInfoBasic("", format, TI_LIST_SUMMARY_FALSE)
lti := NewLicenseTestInfo("", format, TI_LIST_SUMMARY_FALSE)
lti.ListLineWrap = listLineWrap
return lti
}
Expand Down Expand Up @@ -341,7 +341,7 @@ func TestLicensePolicyCustomListGoodBadMaybe(t *testing.T) {
// test for sep. row
TEST_LINE_NUM := 1
TEST_VALUES := []string{REPORT_LIST_TITLE_ROW_SEPARATOR}
matchFoundLine, matchFound := lineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
matchFoundLine, matchFound := bufferLineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
if !matchFound {
t.Errorf("policy file does not contain expected values: `%v` at line: %v\n", TEST_VALUES, TEST_LINE_NUM)
return
Expand All @@ -352,7 +352,7 @@ func TestLicensePolicyCustomListGoodBadMaybe(t *testing.T) {
// Assure "bad" policy has usage "deny"
TEST_LINE_NUM = 2
TEST_VALUES = []string{LICENSE_ID_BAD, schema.POLICY_DENY}
matchFoundLine, matchFound = lineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
matchFoundLine, matchFound = bufferLineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
if !matchFound {
t.Errorf("policy file does not contain expected values: `%v` at line: %v\n", TEST_VALUES, TEST_LINE_NUM)
return
Expand All @@ -363,7 +363,7 @@ func TestLicensePolicyCustomListGoodBadMaybe(t *testing.T) {
// Assure "good" policy has usage "allow"
TEST_LINE_NUM = 3
TEST_VALUES = []string{LICENSE_ID_GOOD, schema.POLICY_ALLOW}
matchFoundLine, matchFound = lineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
matchFoundLine, matchFound = bufferLineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
if !matchFound {
t.Errorf("policy file does not contain expected values: `%v` at line: %v\n", TEST_VALUES, TEST_LINE_NUM)
return
Expand All @@ -374,7 +374,7 @@ func TestLicensePolicyCustomListGoodBadMaybe(t *testing.T) {
// Assure "maybe" policy has usage "needs-review"
TEST_LINE_NUM = 4
TEST_VALUES = []string{LICENSE_ID_MAYBE, schema.POLICY_NEEDS_REVIEW}
matchFoundLine, matchFound = lineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
matchFoundLine, matchFound = bufferLineContainsValues(outputBuffer, TEST_LINE_NUM, TEST_VALUES...)
if !matchFound {
t.Errorf("policy file does not contain expected values: `%v` at line: %v\n", TEST_VALUES, TEST_LINE_NUM)
return
Expand Down
Loading

0 comments on commit aa13384

Please sign in to comment.