dagger-helm/shuttletask/format_test.go
2023-04-06 22:33:29 +02:00

33 lines
644 B
Go

package main
import (
"context"
"os"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCompile(t *testing.T) {
t.Parallel()
t.Run("With testdata", func(t *testing.T) {
ctx := context.Background()
err := format(ctx, withPath("testdata/test_module"))
assert.NoError(t, err)
file, err := os.ReadFile("testdata/test_module/very_long_line.go")
assert.NoError(t, err)
assert.Equal(t, string(file), `package testmodule
func SomeFunction(
with, lots, of, parameters, more, more, more, more, more string,
) (and string, lots string, of string, someerror string, returns string) {
return "", "", "", "", ""
}
`)
})
}