67 lines
925 B
Go
67 lines
925 B
Go
// Code generated by convertFourslash; DO NOT EDIT.
|
|
// To modify this test, run "npm run makemanual formatDocumentWithTrivia"
|
|
|
|
package fourslash_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/microsoft/typescript-go/internal/fourslash"
|
|
"github.com/microsoft/typescript-go/internal/testutil"
|
|
)
|
|
|
|
func TestFormatDocumentWithTrivia(t *testing.T) {
|
|
fourslash.SkipIfFailing(t)
|
|
t.Parallel()
|
|
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
|
|
const content = `
|
|
// 1 below
|
|
|
|
// 2 above
|
|
|
|
let x;
|
|
|
|
// abc
|
|
|
|
let y;
|
|
|
|
// 3 above
|
|
|
|
while (true) {
|
|
while (true) {
|
|
}
|
|
|
|
// 4 above
|
|
}
|
|
|
|
// 5 above
|
|
|
|
`
|
|
f, done := fourslash.NewFourslash(t, nil /*capabilities*/, content)
|
|
defer done()
|
|
f.FormatDocument(t, "")
|
|
f.VerifyCurrentFileContent(t, `
|
|
// 1 below
|
|
|
|
// 2 above
|
|
|
|
let x;
|
|
|
|
// abc
|
|
|
|
let y;
|
|
|
|
// 3 above
|
|
|
|
while (true) {
|
|
while (true) {
|
|
}
|
|
|
|
// 4 above
|
|
}
|
|
|
|
// 5 above
|
|
|
|
`)
|
|
}
|