Skip to content

Commit

Permalink
add ansic strip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krrrr38 committed Jan 15, 2023
1 parent 46b0ad8 commit a3b0ac4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions server/events/terraform/ansi/strip_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package ansi

import "testing"

func TestStrip(t *testing.T) {
tests := []struct {
name string
str string
want string
}{
{
name: "strip ansi",
str: `
+ create
Plan: 3 to add, 0 to change, 0 to destroy.
`,
want: `
+ create
Plan: 3 to add, 0 to change, 0 to destroy.
`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := Strip(tt.str); got != tt.want {
t.Errorf("Strip() = %v, want %v", got, tt.want)
}
})
}
}

0 comments on commit a3b0ac4

Please sign in to comment.