Skip to content

Commit

Permalink
Fixed unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aurc committed Jun 20, 2022
1 parent d617956 commit e56dd13
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 14 deletions.
14 changes: 13 additions & 1 deletion config-sample/gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ keys:
- name: timestamp
type: datetime
layout: 2006-01-02T15:04:05-0700
color:
foreground: purple
background: black
- name: severity
type: string
color:
Expand All @@ -26,7 +29,16 @@ keys:
background: black
- name: resource/labels/container_name
type: string
color:
foreground: darkgreen
background: black
- name: trace
type: string
color:
foreground: white
background: black
- name: jsonPayload/message
type: string
type: string
color:
foreground: white
background: black
16 changes: 8 additions & 8 deletions internal/char/canvas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,14 @@ func TestCanvas_BlankCanvasAsString(t *testing.T) {
name: "Test l`oGGo",
words: LoggoLogo,
wants: `╔╦╦╦╦╦╦╦╦▓▓░╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗
╠▓▓▓░╬╬╬╬▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓░╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╬▓▓▓░╬╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬╬╬▓▓▓▓▓░╬╬╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬╬╬▓▓▓▓▓░╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╣
╠╬╬▓▓░╬╬╬▓▓░╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬╬▓▓▓▓▓░╬▓▓▓▓▓░╬╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬▓▓░╬╬╬╣
╠╬╬▓▓░╬╬╬▓▓░╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬╬╬╬▓▓░╬╬╬▓▓░╬╬╬╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬▓▓░╬╬╬╣
╠╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╬╬▓▓░╬╬╬▓▓▓░╬╬╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╣
╠▓▓▓░╬╬╬╬▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓░╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓░╬╬╬╬▓▓░╬╬╬╬╬╬╬▓▓░╬╬╬╬▓▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬╬╬▓▓▓▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓▓▓▓░╬╬╬╬╬╬╣
╠╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╣
╠╬╬▓▓░╬╬╬▓▓░╬╬╬╬╬╬▓▓░╬▓▓▓▓▓░╬╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬╬▓▓▓▓▓░╬▓▓░╬╬╬╬╬╬▓▓░╬╬╬╣
╠╬╬▓▓░╬╬╬▓▓░╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬╬╬╬▓▓░╬▓▓░╬╬╬╬╬╬▓▓░╬╬╬╣
╠╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬▓▓▓░╬╬╬╬╬╬▓▓░╬╬╬╬╬▓▓░╬╬╬╬╬╬▓▓▓░╬╬╬▓▓░╬╬╬╬▓▓░╬╬╬╬╣
╠╬╬╬▓▓▓░╬╬╬╬▓▓▓▓▓░╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓░╬╬╬╬╬╬╬╬╬▓▓▓▓▓▓▓░╬╬╬╬╬╬╬╬▓▓▓▓▓░╬╬╬╬╬╬╣
╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝`,
},
Expand Down
27 changes: 22 additions & 5 deletions internal/config/log_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func TestMakeConfig(t *testing.T) {
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
test.wants.LastSavedName = test.givenFile
c, err := MakeConfig(test.givenFile)
if test.wantsError {
assert.Error(t, err)
Expand Down Expand Up @@ -121,6 +122,10 @@ var defConfig = Config{
Name: "timestamp",
Type: TypeDateTime,
Layout: "2006-01-02T15:04:05-0700",
Color: Color{
Foreground: "purple",
Background: "black",
},
},
{
Name: "severity",
Expand All @@ -140,37 +145,49 @@ var defConfig = Config{
{
MatchValue: "INFO",
Color: Color{
Foreground: "white",
Foreground: "green",
Background: "black",
},
},
{
MatchValue: "WARN",
Color: Color{
Foreground: "red",
Background: "yellow",
Foreground: "yellow",
Background: "black",
},
},
{
MatchValue: "DEBUG",
Color: Color{
Foreground: "white",
Background: "blue",
Foreground: "blue",
Background: "black",
},
},
},
},
{
Name: "resource/labels/container_name",
Type: TypeString,
Color: Color{
Foreground: "darkgreen",
Background: "black",
},
},
{
Name: "trace",
Type: TypeString,
Color: Color{
Foreground: "white",
Background: "black",
},
},
{
Name: "jsonPayload/message",
Type: TypeString,
Color: Color{
Foreground: "white",
Background: "black",
},
},
},
}

0 comments on commit e56dd13

Please sign in to comment.