Reorganize tests into named testsets and cover UDF value marshalling (#270)#351
Open
JohnCobbler wants to merge 2 commits into
Open
Reorganize tests into named testsets and cover UDF value marshalling (#270)#351JohnCobbler wants to merge 2 commits into
JohnCobbler wants to merge 2 commits into
Conversation
Reorganize the monolithic test/runtests.jl into named @testset blocks grouped by functional area (type conversion, DB open/close, tables interface, execute/query, transactions, load!/drop!, strict mode, UDF registration, serialization, Dates, backup, Stmt scope) under a single top-level "SQLite" testset. This is a pure reorganization with no semantic changes: no test is added, removed, reordered across a state dependency, or weakened. The assertion count is unchanged (155 @test + 22 @test_throws) and the suite reports the same 181 passing tests as before. State-coupled blocks are kept together and annotated; a couple of previously-shared tables are recreated locally so each testset is self-contained. Addresses JuliaDatabases#270.
Add a "UDF value marshalling" testset that round-trips values through a registered identity UDF, exercising both SQLite.sqlvalue (argument unmarshalling) and SQLite.sqlreturn (result marshalling) and asserting exact equality. The Int64-boundary cases (typemax/typemin(Int64), 2^40, 2^31, the Int32 limits and values just past them) close a real coverage gap: nothing in the suite previously passed a UDF an integer outside the Int32 range, so the `Sys.WORD_SIZE == 64` branch in sqlvalue was untested — flipping it to sqlite3_value_int (the 32-bit path) silently truncated large integers with no failing test. The remaining cases cover the Float64, String, blob and NULL branches of sqlvalue. Addresses JuliaDatabases#270.
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.
Closes #270.
The suite was one ~1000-line file with three coarse top-level testsets, so it was hard to see which setup belonged to which tests or what each group asserted. This restructures
test/runtests.jlinto named@testsetblocks grouped by functional area (DB open/close, tables interface, execute/query, transactions, load!/drop!, strict mode, UDF registration, serialization, backup, Stmt scope, …) under a single top-levelSQLitetestset. State-coupled blocks are kept together and annotated, and a couple of previously cross-test-shared tables are recreated locally so each testset stands alone.Commit 1 is a pure reorganization with zero semantic changes — no test added, removed, reordered across a state dependency, or weakened; assertion count unchanged and the suite still reports 181 passing tests.
Commit 2 adds a
UDF value marshallingtestset that round-trips values through a registered identity UDF and asserts exact equality. The Int64-boundary integer cases close a real coverage gap surfaced by mutation testing: nothing previously passed a UDF an integer outside the Int32 range, so the word-size branch insqlvaluecould be flipped to the 32-bit read path and silently truncate large integers with no failing test. The remaining cases cover the Float64, String (including multi-byte UTF-8), blob and NULL branches.