This commit is contained in:
Pere Diaz Bou
2025-03-27 13:24:34 +01:00
parent 4ee60348f2
commit bf37fd3314
21 changed files with 438 additions and 197 deletions

View File

@@ -1,6 +1,6 @@
use crate::common::{self, maybe_setup_tracing};
use crate::common::{compare_string, do_flush, TempDatabase};
use limbo_core::{Connection, StepResult};
use limbo_core::{Connection, RefValue, StepResult};
use log::debug;
use std::rc::Rc;
@@ -47,12 +47,12 @@ fn test_simple_overflow_page() -> anyhow::Result<()> {
let first_value = row.get_value(0);
let text = row.get_value(1);
let id = match first_value {
limbo_core::OwnedValue::Integer(i) => *i as i32,
limbo_core::OwnedValue::Float(f) => *f as i32,
limbo_core::RefValue::Integer(i) => *i as i32,
limbo_core::RefValue::Float(f) => *f as i32,
_ => unreachable!(),
};
let text = match text {
limbo_core::OwnedValue::Text(t) => t.as_str(),
limbo_core::RefValue::Text(t) => t.as_str(),
_ => unreachable!(),
};
assert_eq!(1, id);
@@ -123,12 +123,12 @@ fn test_sequential_overflow_page() -> anyhow::Result<()> {
let first_value = row.get_value(0);
let text = row.get_value(1);
let id = match first_value {
limbo_core::OwnedValue::Integer(i) => *i as i32,
limbo_core::OwnedValue::Float(f) => *f as i32,
limbo_core::RefValue::Integer(i) => *i as i32,
limbo_core::RefValue::Float(f) => *f as i32,
_ => unreachable!(),
};
let text = match text {
limbo_core::OwnedValue::Text(t) => t.as_str(),
limbo_core::RefValue::Text(t) => t.as_str(),
_ => unreachable!(),
};
let huge_text = &huge_texts[current_index];
@@ -194,8 +194,8 @@ fn test_sequential_write() -> anyhow::Result<()> {
let row = rows.row().unwrap();
let first_value = row.get_values().first().expect("missing id");
let id = match first_value {
limbo_core::OwnedValue::Integer(i) => *i as i32,
limbo_core::OwnedValue::Float(f) => *f as i32,
limbo_core::RefValue::Integer(i) => *i as i32,
limbo_core::RefValue::Float(f) => *f as i32,
_ => unreachable!(),
};
assert_eq!(current_read_index, id);
@@ -260,7 +260,7 @@ fn test_regression_multi_row_insert() -> anyhow::Result<()> {
let row = rows.row().unwrap();
let first_value = row.get_values().first().expect("missing id");
let id = match first_value {
limbo_core::OwnedValue::Float(f) => *f as i32,
RefValue::Float(f) => *f as i32,
_ => panic!("expected float"),
};
actual_ids.push(id);
@@ -370,8 +370,8 @@ fn test_wal_checkpoint() -> anyhow::Result<()> {
let row = rows.row().unwrap();
let first_value = row.get_value(0);
let id = match first_value {
limbo_core::OwnedValue::Integer(i) => *i as i32,
limbo_core::OwnedValue::Float(f) => *f as i32,
RefValue::Integer(i) => *i as i32,
RefValue::Float(f) => *f as i32,
_ => unreachable!(),
};
assert_eq!(current_index, id as usize);
@@ -434,7 +434,7 @@ fn test_wal_restart() -> anyhow::Result<()> {
let row = rows.row().unwrap();
let first_value = row.get_value(0);
let count = match first_value {
limbo_core::OwnedValue::Integer(i) => i,
RefValue::Integer(i) => i,
_ => unreachable!(),
};
debug!("counted {}", count);