fix: restore iota blocks, asm --format flag and prose after the syntax pass
Test / vet (push) Successful in 48s
Test / test (push) Successful in 2m35s
Test / build (push) Successful in 40s

This commit is contained in:
2026-08-29 17:12:53 +02:00
parent 15e8b88d32
commit 56ad158772
34 changed files with 170 additions and 183 deletions
+8 -8
View File
@@ -32,7 +32,7 @@ func TestGolden(t *testing.T) {
"\tVFMADD231PD Z14, Z12, Z10\n" +
"\tRET\n"
got := Source("f_amd64.s", in)
got := Source(in)
if got != want {
t.Fatalf("formatting mismatch:\n--- got ---\n%q\n--- want ---\n%q", got, want)
}
@@ -64,13 +64,13 @@ func TestDocCommentIndent(t *testing.T) {
"TEXT ·second(SB), NOSPLIT, $0\n" +
"\tRET\n"
got := Source("d_amd64.s", in)
got := Source(in)
if got != want {
t.Fatalf("formatting mismatch:\n--- got ---\n%q\n--- want ---\n%q", got, want)
}
// Body comments stay indented.
body := "#include \"textflag.h\"\nTEXT ·f(SB), NOSPLIT, $0\n// inside the body\nXORQ AX, AX\nRET\n"
gotBody := Source("b_amd64.s", body)
gotBody := Source(body)
if !strings.Contains(gotBody, "\t// inside the body\n") {
t.Fatalf("body comment must stay indented:\n%q", gotBody)
}
@@ -125,11 +125,11 @@ func TestBlankLines(t *testing.T) {
"GLOBL ·mask(SB), RODATA, $8\n" +
"DATA ·mask+0(SB)/4, $1\n"
got := Source("b_amd64.s", in)
got := Source(in)
if got != want {
t.Fatalf("formatting mismatch:\n--- got ---\n%q\n--- want ---\n%q", got, want)
}
if again := Source("b_amd64.s", got); again != got {
if again := Source(got); again != got {
t.Fatalf("not idempotent:\n%q", again)
}
}
@@ -163,8 +163,8 @@ func TestIdempotent(t *testing.T) {
if err != nil {
t.Fatal(err)
}
once := Source("sample_amd64.s", string(src))
twice := Source("sample_amd64.s", once)
once := Source(string(src))
twice := Source(once)
if once != twice {
t.Fatal("formatting is not idempotent on the fixture")
}
@@ -179,7 +179,7 @@ func TestRoundTrip(t *testing.T) {
if err != nil {
t.Fatal(err)
}
formatted := Source(path, string(src))
formatted := Source(string(src))
if _, errs := parser.Parse(path, formatted); len(errs) > 0 {
t.Errorf("formatted %s no longer parses: %v", path, errs)
}