mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 12:04:21 +01:00
2
.github/workflows/rust.yml
vendored
2
.github/workflows/rust.yml
vendored
@@ -17,6 +17,8 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Check formatting
|
||||
run: cargo fmt --check
|
||||
- name: Check formatting (fuzz)
|
||||
run: cd fuzz && cargo fmt --check
|
||||
|
||||
build-native:
|
||||
strategy:
|
||||
|
||||
54
fuzz/Cargo.lock
generated
54
fuzz/Cargo.lock
generated
@@ -564,26 +564,6 @@ dependencies = [
|
||||
"turso_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "limbo_series"
|
||||
version = "0.1.0-pre.2"
|
||||
dependencies = [
|
||||
"mimalloc",
|
||||
"turso_ext",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "limbo_time"
|
||||
version = "0.1.0-pre.2"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"mimalloc",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"thiserror 2.0.12",
|
||||
"turso_ext",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "linux-raw-sys"
|
||||
version = "0.4.15"
|
||||
@@ -1018,16 +998,7 @@ version = "1.0.69"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
|
||||
dependencies = [
|
||||
"thiserror-impl 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "2.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
|
||||
dependencies = [
|
||||
"thiserror-impl 2.0.12",
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1041,17 +1012,6 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "2.0.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tinystr"
|
||||
version = "0.7.6"
|
||||
@@ -1095,7 +1055,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "turso_core"
|
||||
version = "0.1.0-pre.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"built",
|
||||
@@ -1108,8 +1068,6 @@ dependencies = [
|
||||
"julian_day_converter",
|
||||
"libloading",
|
||||
"libm",
|
||||
"limbo_series",
|
||||
"limbo_time",
|
||||
"miette",
|
||||
"mimalloc",
|
||||
"parking_lot",
|
||||
@@ -1122,7 +1080,7 @@ dependencies = [
|
||||
"ryu",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"thiserror 1.0.69",
|
||||
"thiserror",
|
||||
"tracing",
|
||||
"turso_ext",
|
||||
"turso_macros",
|
||||
@@ -1133,7 +1091,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "turso_ext"
|
||||
version = "0.1.0-pre.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"getrandom 0.3.1",
|
||||
@@ -1142,7 +1100,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "turso_macros"
|
||||
version = "0.1.0-pre.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1151,7 +1109,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "turso_sqlite3_parser"
|
||||
version = "0.1.0-pre.2"
|
||||
version = "0.1.1"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#![no_main]
|
||||
use libfuzzer_sys::{fuzz_target, Corpus};
|
||||
use turso_core::numeric::StrToF64;
|
||||
use std::error::Error;
|
||||
use turso_core::numeric::StrToF64;
|
||||
|
||||
fn do_fuzz(text: String) -> Result<Corpus, Box<dyn Error>> {
|
||||
let expected = {
|
||||
@@ -13,7 +13,7 @@ fn do_fuzz(text: String) -> Result<Corpus, Box<dyn Error>> {
|
||||
|
||||
let actual = turso_core::numeric::str_to_f64(&text)
|
||||
.map(|v| {
|
||||
let (StrToF64::Fractional(non_nan) | StrToF64::Decimal(non_nan)) = v;
|
||||
let (StrToF64::Fractional(non_nan) | StrToF64::Decimal(non_nan)) = v;
|
||||
f64::from(non_nan)
|
||||
})
|
||||
.unwrap_or(0.0);
|
||||
|
||||
@@ -4,7 +4,7 @@ use std::{error::Error, num::NonZero, sync::Arc};
|
||||
|
||||
use arbitrary::Arbitrary;
|
||||
use libfuzzer_sys::{fuzz_target, Corpus};
|
||||
use turso_core::{Value, IO as _};
|
||||
use turso_core::IO as _;
|
||||
|
||||
macro_rules! str_enum {
|
||||
($vis:vis enum $name:ident { $($variant:ident => $value:literal),*, }) => {
|
||||
@@ -63,7 +63,7 @@ str_enum! {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Arbitrary, Debug, Clone)]
|
||||
#[derive(Arbitrary, Debug, Clone, PartialEq)]
|
||||
enum Value {
|
||||
Null,
|
||||
Integer(i64),
|
||||
@@ -184,7 +184,7 @@ fn do_fuzz(expr: Expr) -> Result<Corpus, Box<dyn Error>> {
|
||||
|
||||
let found = 'value: {
|
||||
let io = Arc::new(turso_core::MemoryIO::new());
|
||||
let db = turso_core::Database::open_file(io.clone(), ":memory:", false)?;
|
||||
let db = turso_core::Database::open_file(io.clone(), ":memory:", false, true)?;
|
||||
let conn = db.connect()?;
|
||||
|
||||
let mut stmt = conn.prepare(sql)?;
|
||||
@@ -206,7 +206,7 @@ fn do_fuzz(expr: Expr) -> Result<Corpus, Box<dyn Error>> {
|
||||
};
|
||||
|
||||
assert_eq!(
|
||||
Value::from(expected.clone()),
|
||||
turso_core::Value::from(Value::from(expected.clone())),
|
||||
found.clone(),
|
||||
"with expression {:?}",
|
||||
expr,
|
||||
|
||||
@@ -66,10 +66,7 @@ struct ColumnDef {
|
||||
|
||||
impl fmt::Display for ColumnDef {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let ColumnDef {
|
||||
name,
|
||||
r#type,
|
||||
} = self;
|
||||
let ColumnDef { name, r#type } = self;
|
||||
write!(f, "{name} {type}",)?;
|
||||
|
||||
Ok(())
|
||||
@@ -338,7 +335,7 @@ fn do_fuzz(Ops(ops): Ops) -> Result<Corpus, Box<dyn Error>> {
|
||||
let rusqlite_conn = rusqlite::Connection::open_in_memory()?;
|
||||
|
||||
let io = Arc::new(turso_core::MemoryIO::new());
|
||||
let db = turso_core::Database::open_file(io.clone(), ":memory:", false)?;
|
||||
let db = turso_core::Database::open_file(io.clone(), ":memory:", false, true)?;
|
||||
let limbo_conn = db.connect()?;
|
||||
|
||||
for op in ops {
|
||||
|
||||
Reference in New Issue
Block a user