mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-10 18:54:22 +01:00
fix formatting
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use anarchist_readable_name_generator_lib::readable_name_custom;
|
||||
use rand::Rng;
|
||||
|
||||
pub mod query;
|
||||
pub mod plan;
|
||||
pub mod query;
|
||||
pub mod table;
|
||||
|
||||
pub trait Arbitrary {
|
||||
@@ -13,7 +13,10 @@ pub trait ArbitraryFrom<T> {
|
||||
fn arbitrary_from<R: Rng>(rng: &mut R, t: &T) -> Self;
|
||||
}
|
||||
|
||||
pub(crate) fn frequency<'a, T, R: rand::Rng>(choices: Vec<(usize, Box<dyn FnOnce(&mut R) -> T + 'a>)>, rng: &mut R) -> T {
|
||||
pub(crate) fn frequency<'a, T, R: rand::Rng>(
|
||||
choices: Vec<(usize, Box<dyn FnOnce(&mut R) -> T + 'a>)>,
|
||||
rng: &mut R,
|
||||
) -> T {
|
||||
let total = choices.iter().map(|(weight, _)| weight).sum::<usize>();
|
||||
let mut choice = rng.gen_range(0..total);
|
||||
|
||||
|
||||
@@ -28,7 +28,9 @@ impl Display for InteractionPlan {
|
||||
for interaction in &self.plan {
|
||||
match interaction {
|
||||
Interaction::Query(query) => write!(f, "{};\n", query)?,
|
||||
Interaction::Assertion(assertion) => write!(f, "-- ASSERT: {};\n", assertion.message)?,
|
||||
Interaction::Assertion(assertion) => {
|
||||
write!(f, "-- ASSERT: {};\n", assertion.message)?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -146,15 +146,16 @@ fn main() {
|
||||
env.connections[connection_index] = SimConnection::Connected(env.db.connect());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
env.io.print_stats();
|
||||
}
|
||||
|
||||
fn process_connection(conn: &mut Rc<Connection>, interaction: &Interaction, stack: &mut Vec<ResultSet>) -> Result<()> {
|
||||
fn process_connection(
|
||||
conn: &mut Rc<Connection>,
|
||||
interaction: &Interaction,
|
||||
stack: &mut Vec<ResultSet>,
|
||||
) -> Result<()> {
|
||||
match interaction {
|
||||
generation::plan::Interaction::Query(_) => {
|
||||
log::debug!("{}", interaction);
|
||||
|
||||
Reference in New Issue
Block a user