Commit 23541c6
test(cbinding): add coverage tests, stress tests, and Python ctypes integration (#447)
Raises pkg/cbinding coverage from 18.1% to 93.3% by adding:
- cbinding_testhelpers.go: CGo wrapper functions enabling Go tests to call
all 9 exported C functions (gosqlx_parse, validate, format, extract_tables,
extract_columns, extract_functions, extract_metadata, version, free)
- cbinding_coverage_test.go: functional tests for all 9 exported functions
with valid SQL, invalid SQL, edge cases (empty, unicode, large, CTE, window),
all DML statement types, and toJSON helper coverage
- cbinding_stress_test.go: 50 goroutines x 100 iterations concurrent parse,
concurrent validate/format, all-functions concurrency, large SQL (100-clause
UNION ALL), unicode SQL, mixed valid/invalid, and version singleton stability
- pkg/cbinding/tests/test_ctypes.py: Python ctypes integration test that skips
gracefully when the shared library has not been built
- pkg/cbinding/tests/run_tests.sh: script to build the library and run Python tests
All 73 tests pass with -race; zero data races detected.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e87c1dc commit 23541c6
5 files changed
Lines changed: 1123 additions & 0 deletions
File tree
- pkg/cbinding
- tests
0 commit comments