Skip to content

Commit 190620d

Browse files
Fix bug in checkInvalidStyleAndAttrs
1 parent 88a8e1c commit 190620d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

internal/assertions/highlighting_assertion_screen_state_comparator.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,11 @@ func (c *screenStateComparator) checkBoldAttr(expectedCell, actualCell *uv.Cell)
132132

133133
func (c *screenStateComparator) checkInvalidStyleAndAttrs(expectedCell, actualCell *uv.Cell) error {
134134
// Intentionally don't add success messages for extra attributes
135+
expectedCellAttributesWithoutBold := expectedCell.Style.Attrs &^ uv.AttrBold
136+
actualCellAttributesWithoutBold := actualCell.Style.Attrs &^ uv.AttrBold
135137

136-
if actualCell.Style.Attrs != expectedCell.Style.Attrs {
137-
attributesWithoutBold := actualCell.Style.Attrs &^ uv.AttrBold
138-
attributeNames := attributesToNames(attributesWithoutBold)
138+
if expectedCellAttributesWithoutBold != actualCellAttributesWithoutBold {
139+
attributeNames := attributesToNames(actualCellAttributesWithoutBold)
139140
return fmt.Errorf(
140141
"Expected no extra attributes, got %s: %s",
141142
english.PluralWord(len(attributeNames), "attribute", "attributes"),

0 commit comments

Comments
 (0)