-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new fract index test that tests without list columns
- Loading branch information
Showing
2 changed files
with
29 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use sqlite::{Connection, ResultCode}; | ||
use sqlite_nostd as sqlite; | ||
|
||
#[test] | ||
fn sort_no_list_col() { | ||
let w = integration_utils::opendb().expect("db opened"); | ||
let db = &w.db; | ||
|
||
db.exec_safe("CREATE TABLE todo (id primary key, position)") | ||
.expect("table created"); | ||
db.exec_safe("SELECT crsql_fract_as_ordered('todo', 'position')") | ||
.expect("as ordered"); | ||
db.exec_safe( | ||
"INSERT INTO todo VALUES (1, 'Zm'), (2, 'ZmG'), (3, 'ZmG'), (4, 'ZmV'), (5, 'Zn')", | ||
) | ||
.expect("inserted initial values"); | ||
db.exec_safe("UPDATE todo_fractindex SET after_id = 2 WHERE id = 5") | ||
.expect("repositioned id 5"); | ||
} |