feat(build): simplify some internal tooling.

This commit is contained in:
Alexandre Pujol 2024-04-02 17:48:03 +01:00
parent 791459e39a
commit 1915fa5175
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
14 changed files with 140 additions and 121 deletions

View file

@ -11,51 +11,6 @@ import (
"github.com/arduino/go-paths-helper"
)
func Test_filterComment(t *testing.T) {
tests := []struct {
name string
line string
wantLine string
wantNext bool
}{
{
name: "comment",
line: "# comment",
wantLine: "",
wantNext: true,
},
{
name: "comment with space",
line: " # comment",
wantLine: "",
wantNext: true,
},
{
name: "no comment",
line: "no comment",
wantLine: "no comment",
wantNext: false,
},
{
name: "no comment # comment",
line: "no comment # comment",
wantLine: "no comment",
wantNext: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotLine, gotNext := filterComment(tt.line)
if gotLine != tt.wantLine {
t.Errorf("filterComment() got = %v, want %v", gotLine, tt.wantLine)
}
if gotNext != tt.wantNext {
t.Errorf("filterComment() got1 = %v, want %v", gotNext, tt.wantNext)
}
})
}
}
func TestFlagger_Read(t *testing.T) {
tests := []struct {
name string