Skip to content

test(query): pin SqliteReadOnlySessionEnforcer non-DbException guard#123

Merged
daniel3303 merged 1 commit into
mainfrom
test/add-sqlitereadonlyviolation-nondbexception-tests
May 28, 2026
Merged

test(query): pin SqliteReadOnlySessionEnforcer non-DbException guard#123
daniel3303 merged 1 commit into
mainfrom
test/add-sqlitereadonlyviolation-nondbexception-tests

Conversation

@daniel3303
Copy link
Copy Markdown
Owner

Summary

  • Adds the negative-path companion to the SQLite read-only detection test: confirms IsReadOnlyViolation requires a DbException before consulting SqlitePrimaryErrorCode.
  • Guards against the reflection lookup leaking past the type check — a non-DbException that happens to expose SqlitePrimaryErrorCode == 8 must return false, so a genuine error is never silently neutralized as a read-only violation.

Code changes

  • tests/Equibles.AgentQL.UnitTests/Query/ReadOnly/SqliteReadOnlySessionEnforcerTests.cs — new [Fact] feeding a non-DbException that exposes a matching SqlitePrimaryErrorCode and asserting detection returns false. Covers the ex is not DbException guard branch.

@daniel3303 daniel3303 merged commit 3d20d0e into main May 28, 2026
4 checks passed
@daniel3303 daniel3303 deleted the test/add-sqlitereadonlyviolation-nondbexception-tests branch May 28, 2026 17:44
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.

1 participant