Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Reuven committed Jul 18, 2024
1 parent 73a0f92 commit 91c8437
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions checker/level_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"strings"
"testing"

"github.com/TwiN/go-color"
"github.com/stretchr/testify/require"
"github.com/tufin/oasdiff/checker"
)
Expand All @@ -17,16 +18,16 @@ func TestStringCond_Info(t *testing.T) {
}

func TestPrettyString(t *testing.T) {
require.Equal(t, "\x1b[36minfo\x1b[0m", checker.INFO.PrettyString())
require.Equal(t, "\x1b[35mwarning\x1b[0m", checker.WARN.PrettyString())
require.Equal(t, "\x1b[31merror\x1b[0m", checker.ERR.PrettyString())
require.Equal(t, "\x1b[37missue\x1b[0m", checker.Level(4).PrettyString())
require.Equal(t, color.InCyan(checker.INFO.String()), checker.INFO.PrettyString())
require.Equal(t, color.InPurple(checker.WARN.String()), checker.WARN.PrettyString())
require.Equal(t, color.InRed(checker.ERR.String()), checker.ERR.PrettyString())
require.Equal(t, color.InGray(checker.Level(4).String()), checker.Level(4).PrettyString())
}

func TestProcessSeverityLevels_InvalidFile(t *testing.T) {
m, err := checker.ProcessSeverityLevels("../data/invalid.txt")
require.Nil(t, m)
require.EqualError(t, err, "open ../data/invalid.txt: no such file or directory")
require.Error(t, err)
}

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

0 comments on commit 91c8437

Please sign in to comment.