Repository navigation
Add unit tests for AssemblyBlock.parse and parseFunctionSymbols - #30
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/DaanV2/vscode-go-asm/sessions/763bc28e-1bf9-4fa0-8cf4-20818dad8299 Co-authored-by: DaanV2 <2393905+DaanV2@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for parser and utilities
Add unit tests for AssemblyBlock.parse and parseFunctionSymbols
Apr 2, 2026
DaanV2
approved these changes
Apr 2, 2026
DaanV2
marked this pull request as ready for review
April 2, 2026 11:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No test coverage existed for the core parsing routines, making regressions invisible. This adds a mocha-based unit test suite covering
AssemblyBlock.parseand the gopls symbol-parsing logic.Changes
src/go/symbols.ts(new)Extracts the gopls output parsing from
getFunctionsinto a pure, VS Code–free functionparseFunctionSymbols(stdout: string): string[]. Required to make the logic importable by mocha without a VS Code runtime.src/go/dependencies.tsDelegates to
parseFunctionSymbolsand re-exports it for backwards compatibility.src/test/assembly-info.test.ts(new — 9 tests)Covers
AssemblyBlock.parse: header extraction, tab-stripping, line counts,#-comment skipping, empty-header/no-data filtering, blank input.src/test/symbols.test.ts(new — 9 tests)Covers
parseFunctionSymbols: function vs. struct/field discrimination, raw + stripped method name pairs (e.g.(*RSAKey).ID→ also emitsRSAKey.ID), deduplication, empty input, CRLF line endings.package.jsonmocha@^10todevDependencies"test": "echo no test yet"with"test": "npm run compile-tests && mocha out/test/**/*.test.js"