mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 00:36:56 +02:00
Add Python regression tests for existing insert/delete paths
Baseline tests protecting non-DiskANN chunk-based insert and delete behavior: vector round-trips, auto rowids, text primary keys, delete validity, reinsert after delete, dimension/type validation, and v_info snapshot. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0bca960e9d
commit
206fbc2bdd
2 changed files with 236 additions and 0 deletions
63
tests/__snapshots__/test-insert-delete.ambr
Normal file
63
tests/__snapshots__/test-insert-delete.ambr
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# serializer version: 1
|
||||
# name: test_info_table_contents
|
||||
OrderedDict({
|
||||
'sql': 'select key, value from v_info order by key',
|
||||
'rows': list([
|
||||
OrderedDict({
|
||||
'key': 'CREATE_VERSION',
|
||||
'value': 'v0.1.7-alpha.10',
|
||||
}),
|
||||
OrderedDict({
|
||||
'key': 'CREATE_VERSION_MAJOR',
|
||||
'value': 0,
|
||||
}),
|
||||
OrderedDict({
|
||||
'key': 'CREATE_VERSION_MINOR',
|
||||
'value': 1,
|
||||
}),
|
||||
OrderedDict({
|
||||
'key': 'CREATE_VERSION_PATCH',
|
||||
'value': 7,
|
||||
}),
|
||||
]),
|
||||
})
|
||||
# ---
|
||||
# name: test_insert_creates_chunks_and_vectors[rowids_count]
|
||||
OrderedDict({
|
||||
'sql': 'select count(*) as cnt from v_rowids',
|
||||
'rows': list([
|
||||
OrderedDict({
|
||||
'cnt': 5,
|
||||
}),
|
||||
]),
|
||||
})
|
||||
# ---
|
||||
# name: test_insert_creates_chunks_and_vectors[vector_chunks_count]
|
||||
OrderedDict({
|
||||
'sql': 'select count(*) as cnt from v_vector_chunks00',
|
||||
'rows': list([
|
||||
OrderedDict({
|
||||
'cnt': 1,
|
||||
}),
|
||||
]),
|
||||
})
|
||||
# ---
|
||||
# name: test_insert_text_primary_key[rowids]
|
||||
OrderedDict({
|
||||
'sql': 'select rowid, id, chunk_id, chunk_offset from v_rowids order by rowid',
|
||||
'rows': list([
|
||||
OrderedDict({
|
||||
'rowid': 1,
|
||||
'id': 'doc_a',
|
||||
'chunk_id': 1,
|
||||
'chunk_offset': 0,
|
||||
}),
|
||||
OrderedDict({
|
||||
'rowid': 2,
|
||||
'id': 'doc_b',
|
||||
'chunk_id': 1,
|
||||
'chunk_offset': 1,
|
||||
}),
|
||||
]),
|
||||
})
|
||||
# ---
|
||||
Loading…
Add table
Add a link
Reference in a new issue