Skip to content

Commit be1ccd8

Browse files
committed
Harden MDS068 link-image-style tests
Two assertions were weak enough to mask a regression: - TestApplySettings_LinkImageStyle_Parses now asserts lis.Active, so a regression that left the axis inactive (silently skipping every check) is caught instead of passing on the six toggle fields alone. - TestCheck_LinkImageStyle_ForbidInline now matches "inline style forbidden" rather than the substring "inline", which also matches "inline-image style forbidden" — so an isImage routing inversion for links would no longer slip through. https://claude.ai/code/session_015t5KNNUG7YjqTVr9ERXVyZ
1 parent a7e8d73 commit be1ccd8

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

internal/rules/linkstyle/rule_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ func TestApplySettings_LinkImageStyle_Parses(t *testing.T) {
455455
}))
456456
require.NoError(t, err)
457457
lis := r.Links.Style.LinkImageStyle
458+
assert.True(t, lis.Active, "configuring link-image-style must mark the axis Active")
458459
assert.False(t, lis.Autolink, "autolink=false must be stored")
459460
assert.True(t, lis.Inline, "inline=true must be stored")
460461
assert.True(t, lis.Full, "full=true must be stored")
@@ -531,7 +532,9 @@ func TestCheck_LinkImageStyle_ForbidInline(t *testing.T) {
531532
}}}
532533
diags := r.Check(f)
533534
require.Len(t, diags, 1)
534-
assert.Contains(t, diags[0].Message, "inline")
535+
// "inline style forbidden" — not "inline-image style forbidden" —
536+
// so an isImage routing inversion for links would be caught.
537+
assert.Contains(t, diags[0].Message, "inline style forbidden")
535538
}
536539

537540
// TestCheck_LinkImageStyle_ForbidFull verifies that full:false flags

0 commit comments

Comments
 (0)