Skip to content

Commit bd5b31f

Browse files
tjametclaude
andcommitted
Fix summary tests to use OS-native EOF instead of hardcoded \n
String comparisons in summary tests used hardcoded "\n" but AddEOL() uses the platform-specific EOF constant ("\r\n" on Windows), causing failures on Windows runners in GitHub Actions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a8eca66 commit bd5b31f

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

core/summary_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,34 +79,34 @@ func TestSummaryStringify(t *testing.T) {
7979
func TestSummaryAddHeading(t *testing.T) {
8080
_, s := withSummaryFile(t)
8181
s.AddHeading("Title", 1)
82-
assert.Equal(t, "<h1>Title</h1>\n", s.Stringify())
82+
assert.Equal(t, "<h1>Title</h1>"+EOF, s.Stringify())
8383
s.EmptyBuffer()
8484
s.AddHeading("Sub", 3)
85-
assert.Equal(t, "<h3>Sub</h3>\n", s.Stringify())
85+
assert.Equal(t, "<h3>Sub</h3>"+EOF, s.Stringify())
8686
}
8787

8888
func TestSummaryAddHeadingDefaultLevel(t *testing.T) {
8989
_, s := withSummaryFile(t)
9090
s.AddHeading("Title")
91-
assert.Equal(t, "<h1>Title</h1>\n", s.Stringify())
91+
assert.Equal(t, "<h1>Title</h1>"+EOF, s.Stringify())
9292
}
9393

9494
func TestSummaryAddSeparator(t *testing.T) {
9595
_, s := withSummaryFile(t)
9696
s.AddSeparator()
97-
assert.Equal(t, "<hr>\n", s.Stringify())
97+
assert.Equal(t, "<hr>"+EOF, s.Stringify())
9898
}
9999

100100
func TestSummaryAddBreak(t *testing.T) {
101101
_, s := withSummaryFile(t)
102102
s.AddBreak()
103-
assert.Equal(t, "<br>\n", s.Stringify())
103+
assert.Equal(t, "<br>"+EOF, s.Stringify())
104104
}
105105

106106
func TestSummaryAddQuote(t *testing.T) {
107107
_, s := withSummaryFile(t)
108108
s.AddQuote("some quote")
109-
assert.Equal(t, "<blockquote>some quote</blockquote>\n", s.Stringify())
109+
assert.Equal(t, "<blockquote>some quote</blockquote>"+EOF, s.Stringify())
110110
s.EmptyBuffer()
111111
s.AddQuote("cited", "https://example.com")
112112
assert.Contains(t, s.Stringify(), `cite="https://example.com"`)
@@ -115,16 +115,16 @@ func TestSummaryAddQuote(t *testing.T) {
115115
func TestSummaryAddLink(t *testing.T) {
116116
_, s := withSummaryFile(t)
117117
s.AddLink("click me", "https://example.com")
118-
assert.Equal(t, `<a href="https://example.com">click me</a>`+"\n", s.Stringify())
118+
assert.Equal(t, `<a href="https://example.com">click me</a>`+EOF, s.Stringify())
119119
}
120120

121121
func TestSummaryAddList(t *testing.T) {
122122
_, s := withSummaryFile(t)
123123
s.AddList([]string{"a", "b", "c"})
124-
assert.Equal(t, "<ul><li>a</li><li>b</li><li>c</li></ul>\n", s.Stringify())
124+
assert.Equal(t, "<ul><li>a</li><li>b</li><li>c</li></ul>"+EOF, s.Stringify())
125125
s.EmptyBuffer()
126126
s.AddList([]string{"1", "2"}, true)
127-
assert.Equal(t, "<ol><li>1</li><li>2</li></ol>\n", s.Stringify())
127+
assert.Equal(t, "<ol><li>1</li><li>2</li></ol>"+EOF, s.Stringify())
128128
}
129129

130130
func TestSummaryAddTable(t *testing.T) {
@@ -142,7 +142,7 @@ func TestSummaryAddTable(t *testing.T) {
142142
func TestSummaryAddDetails(t *testing.T) {
143143
_, s := withSummaryFile(t)
144144
s.AddDetails("label", "content")
145-
assert.Equal(t, "<details><summary>label</summary>content</details>\n", s.Stringify())
145+
assert.Equal(t, "<details><summary>label</summary>content</details>"+EOF, s.Stringify())
146146
}
147147

148148
func TestSummaryAddCodeBlock(t *testing.T) {

0 commit comments

Comments
 (0)