Skip to content

parser - Issue #202(API tools) - #214

Open
Sidd-Pelluru wants to merge 3 commits into
developfrom
202-improve-unit-tests-in-sectionparser_testgo
Open

Sidd-Pelluru wants to merge 3 commits into
developfrom
202-improve-unit-tests-in-sectionparser_testgo

Conversation

@Sidd-Pelluru

@Sidd-Pelluru Sidd-Pelluru commented Oct 29, 2026 •

Copy link
Copy Markdown

…based test cases with slices of structs so test order is deterministic.

Description

worked on issue #202 which was changing from a map to a slice to make it more deterministic

Testing

To test it:

  1. Check out the branch:
    git fetch origin
    git checkout 202-improve-unit-tests-in-sectionparser_testgo

  2. Run the parser tests:
    go test ./parser/... -v or go test ./... -v

  3. Confirm the expected result:

    • All tests pass
    • The panic cases (missing_section_number, empty_string,
      garbage_in_garbage_out) show as named subtests

AI Disclosure

Came up with how I thought I could do it and just asked AI to review it without chaining my version and giving any hints or generating the code for me

Checklist

  • Create this PR
  • [ x] Perform final self-review

…based test cases with slices of structs so test order is deterministic.
@Sidd-Pelluru Sidd-Pelluru linked an issue Oct 29, 2026 that may be closed by this pull request
@Sidd-Pelluru
Sidd-Pelluru requested review from a team as code owners October 29, 2026 19:13
Sidd-Pelluru and others added 2 commits October 29, 2026 15:41
…-based fails and TestParseTimeOrPanic cases with slices of structs that have a Name field, so test order is deterministic and changed syntax in the loops after changing from map to slice and removed the fmt package which was used to make names for unnamed test cases and updated code gets the name from the struct instead as go treats unused imports as errors

This branch has not been deployed

No deployments
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.

Improve unit tests in sectionParser_test.go

1 participant