Skip to content

Commit

Permalink
fix(tests/legacy): relax json string requirement
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Guerra <[email protected]>
  • Loading branch information
LucaGuerra authored and poiana committed Aug 30, 2024
1 parent 32e319a commit d259272
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/falco/legacy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
"context"
"errors"
"os"
"strings"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -159,10 +160,16 @@ func TestFalco_Legacy_StdoutOutputJsonStrict(t *testing.T) {
assert.Nil(t, err)
scanner := bufio.NewScanner(bytes.NewReader(expectedContent))
scanner.Split(bufio.ScanLines)
var expectedJsonLines []string
for scanner.Scan() {
assert.Contains(t, res.Stdout(), scanner.Text())
expectedJsonLines = append(expectedJsonLines, scanner.Text())
}
assert.Nil(t, scanner.Err())

outputLines := strings.Split(res.Stdout(), "\n")
for i, expectedLine := range expectedJsonLines {
require.JSONEq(t, expectedLine, outputLines[i])
}
}

func TestFalco_Legacy_ListAppendFalse(t *testing.T) {
Expand Down

0 comments on commit d259272

Please sign in to comment.