test(regression): suite for session bugs (MariaDB type names, RowDisplayCache, PluginCellValue.asText)#1218
Merged
Conversation
… eviction, and PluginCellValue.asText contract
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.
Summary
Regression tests covering the testable units fixed during the recent debugging session. Every test corresponds to a bug surfaced and fixed in a prior PR; the goal is to catch the same regression if anyone refactors these paths again.
Coverage map
0x31for1)MariaDBFieldClassifierTests(existing) + newMariaDBTypeNameTests.numericTypes / decimalAndFloat / temporalTypes / miscTypesfield.charsetnr == 63flagging non-binary typesMariaDBFieldClassifierTests(existing)MariaDBTypeNameTests.binaryWith*+varbinaryWith*+charWithout*VARBINARYonly when binary-flag set and charset is 63; case 254 →BINARYlikewise; non-binary staysVARCHAR/CHARmariadb_field_attrJSON over-readMariaDBTypeNameTests.miscTypeschecking type 245 →JSON; the over-read fix is in code paths that consult the function frommysqlTypeToString, which is integration-level)JSON(the JSON detection from extended metadata requires real MariaDB connector and is integration-tested only)NSCache + RowIDKeyforDictionaryRowDisplayCacheTests(new)removeAllresets state, mixedRowID.existing/RowID.insertedround-trip.bytes.asTextreturning empty would have caused click-to-wipePluginCellValueSortKeyTests.asText / bytesAsTextIsNil / nullAsText / asBytes(extended)Refactor for testability
mysqlTypeToString(_:)previously tookUnsafePointer<MYSQL_FIELD>, which can't be constructed without a live MariaDB result handle. Extracted the pure switch into a newmariaDBTypeName(typeRaw:flags:charsetnr:length:) -> String(internal). The MYSQL_FIELD-facing function now does the JSONmariadb_field_attrcheck and the ENUM/SET flag check at the C-struct level, then delegates the type-code switch tomariaDBTypeName. Tests callmariaDBTypeNamedirectly with primitives.What is NOT covered by these tests (and why)
error is CancellationError || Task.isCancelleddefensively; integration test only.NSView.needsDisplay, which AppKit consumes asynchronously. Would need a snapshot or NSView mock harness..onAppear/.taskin unit tests without a realApp.Test plan
xcodebuild test -only-testing:TableProTests/MariaDBTypeNameTests— all pass.xcodebuild test -only-testing:TableProTests/RowDisplayCacheTests— all pass.xcodebuild test -only-testing:TableProTests/PluginCellValueSortKeyTests— all pass (including new asText / asBytes cases).xcodebuild -project TablePro.xcodeproj -scheme TablePro test -skipPackagePluginValidation.** TEST SUCCEEDED **on the four target suites.