8000 Split the long tests of the library core into smaller ones by dominion525 · Pull Request #126 · dominion525/jetdb · GitHub
[go: up one dir, main page]

Skip to content

Split the long tests of the library core into smaller ones - #126

Merged
dominion525 merged 6 commits into
mainfrom
test/split-long-tests
Oct 24, 2026
Merged

dominion525 merged 6 commits into
mainfrom
test/split-long-tests

Conversation

@dominion525
Copy link
Copy Markdown
Owner

Summary

  • Nine tests of data.rs, table.rs, file.rs, storage.rs, prop.rs and ddl were above the complexity thresholds of scripts/quality-check.sh (CC ≥ 10, cognitive ≥ 10 or SLOC ≥ 50). Each is now split by what it checks, or has its helpers and expected values moved out of it, and none of them is above the thresholds.
  • What the tests check is unchanged. The only thing dropped is the reading of the definition of MSysObjects in the null mask test, whose result was not used.
  • The test of AutoNumber columns now fails when a test file that exists cannot be opened, as the other tests do, rather than passing over it.
  • Functions above the thresholds: 144 → 135. Tests: 1085 → 1093.
Test Before (CC / Cog / SLOC) After, the largest function Tests
data assert_msysobjects_rows 11 / 7 / 42 6 / 1 / 23 1
data table_rows_pass_over_deleted_and_unreadable_rows 1 / 0 / 51 1 / 0 / 19 3
data dispatch_boolean_from_null_mask 1 / 0 / 51 2 / 0 / 20 1
data calculated_field_values_match_jackcess 10 / 6 / 89 7 / 6 / 49 3
table is_auto_number_of_real_columns 10 / 3 / 37 3 / 0 / 11 3
file file_error_display_all_variants 1 / 0 / 55 1 / 0 / 30 3
storage the_in_functions_read_what_the_others_read 6 / 7 / 81 2 / 3 / 23 1
prop properties_of_the_object_of_a_type 11 / 3 / 47 7 / 2 / 12 1
ddl japanese_identifiers_sqlite 1 / 0 / 52 2 / 1 / 36 1

🤖 Generated with Claude Code

dominion525 and others added 6 commits October 25, 2026 00:51
…them easier to read

- Split the test of deleted and unreadable rows into three: a readable row, a deleted row and an unreadable row
- Split the comparison of calculated columns with Jackcess into three tests by the type of the result, with the expected values written column by column
- Make the Boolean column of the null mask test a function, and drop the reading of the definition of MSysObjects, which the test does not use
- Check the types of the values of MSysObjects with matches! rather than match

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Make the reading of the names of AutoNumber columns a function, rather than closures in the test
- Split the test into three, of Jet3, of complex columns and of ACE, which skip_if_missing! skips when the test data is absent

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ke it easier to read

- Split the twelve errors into three tests: names not found, invalid data, and passwords and encryption
- Write each error with the texts its message holds as a table, checked by one function

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… it compares, to make it easier to read

- Make the comparisons of forms and reports, of macros and of the VBA project functions, each giving how many it compared
- Leave the test to call the three functions for each database and add up the counts

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ier to read

- Make the two closures of the test, which read the names of the columns and the Description, functions outside it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Check the four names that should be quoted in one loop over them
- Write the definition of each column on one line

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Coverage

For c74b0c4.

Filename                       Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
jetdb-cli/src/export.rs            108                11    89.81%           5                 0   100.00%          66                 6    90.91%           0                 0         -
jetdb-cli/src/form.rs              254                24    90.55%          19                 5    73.68%         152                 9    94.08%           0                 0         -
jetdb-cli/src/macro_cmd.rs         151                11    92.72%          11                 2    81.82%          81                 5    93.83%           0                 0         -
jetdb-cli/src/main.rs              864                38    95.60%          70                 2    97.14%         549                25    95.45%           0                 0         -
jetdb-cli/src/prop.rs              308                15    95.13%          33                 2    93.94%         186                10    94.62%           0                 0         -
jetdb-cli/src/query.rs              80                 4    95.00%           5                 0   100.00%          51                 1    98.04%           0                 0         -
jetdb-cli/src/vba.rs                74                 4    94.59%           5                 0   100.00%          47                 1    97.87%           0                 0         -
jetdb-wasm/src/lib.rs             3841                95    97.53%         246                 4    98.37%        2009                22    98.90%           0                 0         -
jetdb/src/catalog.rs               531                14    97.36%          41                 0   100.00%         304                 7    97.70%           0                 0         -
jetdb/src/complex.rs               917                32    96.51%          73                 0   100.00%         607                15    97.53%           0                 0         -
jetdb/src/crypto.rs               2284               210    90.81%         105                21    80.00%        1301               169    87.01%           0                 0         -
jetdb/src/csv.rs                   810                23    97.16%          65                 0   100.00%         453                 6    98.68%           0                 0         -
jetdb/src/data.rs                 4542               177    96.10%         254                 3    98.82%        2549               108    95.76%           0                 0         -
jetdb/src/ddl/access.rs             70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/mod.rs              2777                 8    99.71%         199                 2    98.99%        1503                 6    99.60%           0                 0         -
jetdb/src/ddl/mysql.rs              70                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/postgres.rs           71                 0   100.00%           7                 0   100.00%          46                 0   100.00%           0                 0         -
jetdb/src/ddl/sqlite.rs             69                 0   100.00%           7                 0   100.00%          48                 0   100.00%           0                 0         -
jetdb/src/encoding.rs              284                 0   100.00%          30                 0   100.00%         153                 0   100.00%           0                 0         -
jetdb/src/file.rs                 1914                67    96.50%         110                 0   100.00%        1042                26    97.50%           0                 0         -
jetdb/src/form.rs                 3253               150    95.39%         227                10    95.59%        1775                69    96.11%           0                 0         -
jetdb/src/form2000.rs              762                21    97.24%          56                 1    98.21%         402                 4    99.00%           0                 0         -
jetdb/src/format.rs                620                 2    99.68%          41                 0   100.00%         408                 2    99.51%           0                 0         -
jetdb/src/lib.rs                     3                 0   100.00%           1                 0   100.00%           3                 0   100.00%           0                 0         -
jetdb/src/macro_action.rs          299                19    93.65%          27                 3    88.89%         163                24    85.28%           0                 0         -
jetdb/src/macro_def.rs            2280                98    95.70%         171                 9    94.74%        1517                46    96.97%           0                 0         -
jetdb/src/macro_text.rs            756                24    96.83%          47                 2    95.74%         426                20    95.31%           0                 0         -
jetdb/src/map.rs                   416                13    96.88%          27                 0   100.00%         221                 5    97.74%           0                 0         -
jetdb/src/money.rs                 286                 0   100.00%          26                 0   100.00%         189                 0   100.00%           0                 0         -
jetdb/src/prop.rs                 1414                56    96.04%          88                 8    90.91%         744                63    91.53%           0                 0         -
jetdb/src/query.rs                2705                78    97.12%         184                 0   100.00%        1682                38    97.74%           0                 0         -
jetdb/src/relationship.rs          302                27    91.06%          12                 0   100.00%         187                17    90.91%           0                 0         -
jetdb/src/save_as_text.rs          574                27    95.30%          52                 3    94.23%         341                27    92.08%           0                 0         -
jetdb/src/storage.rs               596                46    92.28%          26                 1    96.15%         316                24    92.41%           0                 0         -
jetdb/src/table.rs                1589                61    96.16%          95                 2    97.89%         939                18    98.08%           0                 0         -
jetdb/src/timestamp.rs             413                 0   100.00%          43                 0   100.00%         232                 0   100.00%           0                 0         -
jetdb/src/vba.rs                   634                65    89.75%          54                16    70.37%         361                60    83.38%           0                 0         -
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                            36921              1420    96.15%        2476                96    96.12%       21145               833    96.06%           0                 0         -

@dominion525
dominion525 merged commit bc3b1da into main Oct 24, 2026
11 checks passed
@dominion525
dominion525 deleted the test/split-long-tests branch October 24, 2026 18:28
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

0