Skip to content

fix: undefined variable in proxy test range loop#1324

Merged
a-h merged 3 commits intomainfrom
copilot/fix-test-code-range-variable
Jan 18, 2026
Merged

fix: undefined variable in proxy test range loop#1324
a-h merged 3 commits intomainfrom
copilot/fix-test-code-range-variable

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 18, 2026

The test TestStreamInsertAfterBodyOpen/large_HTML_with_script_tags_maintains_character_integrity had a compilation error due to a missing index variable in a range loop.

Changes

  • Added index variable i to for range 50 loop in proxy_test.go:805
// Before - compilation error: undefined: i
for range 50 {
    inputBuilder.WriteString(fmt.Sprintf("<div>%d padding</div>\n", i))
}

// After
for i := range 50 {
    inputBuilder.WriteString(fmt.Sprintf("<div>%d padding</div>\n", i))
}

The loop generates 50 numbered div elements as padding content for testing large HTML document handling.

Original prompt

I broke the test code by removing the i variable in the range. Can you fix it?


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 18, 2026 18:50
Co-authored-by: a-h <1029947+a-h@users.noreply.github.com>
Co-authored-by: a-h <1029947+a-h@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test code by restoring i variable in range Fix undefined variable in proxy test range loop Jan 18, 2026
Copilot AI requested a review from a-h January 18, 2026 18:51
@a-h a-h marked this pull request as ready for review January 18, 2026 18:53
@a-h a-h changed the title Fix undefined variable in proxy test range loop fix: undefined variable in proxy test range loop Jan 18, 2026
@a-h a-h merged commit b666bd7 into main Jan 18, 2026
9 checks passed
@a-h a-h deleted the copilot/fix-test-code-range-variable branch January 18, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants