test(plugin): improve tests for auto (#7348)

This commit is contained in:
Ville Vesilehto
2025-06-05 00:37:52 +03:00
committed by GitHub
parent 11774d9e98
commit ddb74cdcf4
7 changed files with 644 additions and 24 deletions

View File

@@ -1,8 +1,12 @@
package auto
import "testing"
import (
"fmt"
"testing"
)
func TestRewriteToExpand(t *testing.T) {
t.Parallel()
tests := []struct {
in string
expected string
@@ -12,9 +16,12 @@ func TestRewriteToExpand(t *testing.T) {
{in: "{1", expected: "${1"},
}
for i, tc := range tests {
got := rewriteToExpand(tc.in)
if got != tc.expected {
t.Errorf("Test %d: Expected error %v, but got %v", i, tc.expected, got)
}
t.Run(fmt.Sprintf("test_%d", i), func(t *testing.T) {
t.Parallel()
got := rewriteToExpand(tc.in)
if got != tc.expected {
t.Errorf("Test %d: Expected error %v, but got %v", i, tc.expected, got)
}
})
}
}