build: update directives with the new interface.

This commit is contained in:
Alexandre Pujol 2024-03-25 22:40:25 +00:00
parent 38e9e5f08e
commit 08d4110c2a
No known key found for this signature in database
GPG key ID: C5469996F0DF68EC
9 changed files with 63 additions and 89 deletions

View file

@ -11,32 +11,6 @@ import (
"github.com/arduino/go-paths-helper"
)
func TestDirective_Usage(t *testing.T) {
tests := []struct {
name string
d Directive
wantMessage string
wantUsage string
}{
{
name: "empty",
d: Directives["stack"],
wantMessage: "Stack directive applied",
wantUsage: `#aa:stack profiles_name...`,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.d.Usage(); got != tt.wantUsage {
t.Errorf("Directive.Usage() = %v, want %v", got, tt.wantUsage)
}
if got := tt.d.Message(); got != tt.wantMessage {
t.Errorf("Directive.Usage() = %v, want %v", got, tt.wantMessage)
}
})
}
}
func TestNewOption(t *testing.T) {
tests := []struct {
name string