feat: with shuttletask; format

This commit is contained in:
2023-04-06 21:59:09 +02:00
commit ee922175c1
6 changed files with 259 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
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 "", "", "", "", ""
}
`)
})
}