feat: with shuttletask; format
This commit is contained in:
32
shuttletask/format_test.go
Normal file
32
shuttletask/format_test.go
Normal 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 "", "", "", "", ""
|
||||
}
|
||||
`)
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user