Skip to content

Fix router test failures with two critical bug fixes#136

Merged
guzba merged 1 commit into
guzba:masterfrom
gokr:router-fix
Jun 29, 2025
Merged

Fix router test failures with two critical bug fixes#136
guzba merged 1 commit into
guzba:masterfrom
gokr:router-fix

Conversation

@gokr
Copy link
Copy Markdown
Contributor

@gokr gokr commented Jun 28, 2025

  1. Operator precedence bug in isPartialWildcard: Fixed incorrect boolean operator precedence that was causing any string ending with '' to be considered a partial wildcard regardless of length requirement. Changed: test.len >= 2 and test.startsWith('') or test.endsWith('') To: test.len >= 2 and (test.startsWith('') or test.endsWith('*'))

  2. Exception handling bug: Fixed router exception handling that wasn't properly catching AssertionDefect. The generic except: block doesn't catch AssertionDefect in Nim, causing test failures when notFoundHandler called doAssert false. Changed: except: to except Exception as e:

🤖 Generated with Claude Code

1. **Operator precedence bug in isPartialWildcard**: Fixed incorrect boolean
   operator precedence that was causing any string ending with '*' to be
   considered a partial wildcard regardless of length requirement.
   Changed: test.len >= 2 and test.startsWith('*') or test.endsWith('*')
   To: test.len >= 2 and (test.startsWith('*') or test.endsWith('*'))

2. **Exception handling bug**: Fixed router exception handling that wasn't
   properly catching AssertionDefect. The generic except: block doesn't catch
   AssertionDefect in Nim, causing test failures when notFoundHandler called
   doAssert false.
   Changed: except: to except Exception as e:

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@guzba guzba merged commit 4747773 into guzba:master Jun 29, 2025
8 checks passed
@guzba guzba mentioned this pull request Jun 29, 2025
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