mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-10 18:54:22 +01:00
Add tests for hes_rowid field
Signed-off-by: Piotr Jastrzebski <haaawk@gmail.com>
This commit is contained in:
@@ -301,6 +301,22 @@ pub fn sqlite_schema_table() -> BTreeTable {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
pub fn test_has_rowid_true() -> Result<()> {
|
||||
let sql = r#"CREATE TABLE t1 (a INTEGER PRIMARY KEY, b TEXT);"#;
|
||||
let table = BTreeTable::from_sql(sql, 0)?;
|
||||
assert!(table.has_rowid, "has_rowid should be set to true");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_has_rowid_false() -> Result<()> {
|
||||
let sql = r#"CREATE TABLE t1 (a INTEGER PRIMARY KEY, b TEXT) WITHOUT ROWID;"#;
|
||||
let table = BTreeTable::from_sql(sql, 0)?;
|
||||
assert!(!table.has_rowid, "has_rowid should be set to false");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn test_sqlite_schema() {
|
||||
let expected = r#"CREATE TABLE sqlite_schema (
|
||||
|
||||
Reference in New Issue
Block a user