AppFlowy/frontend/rust-lib/event-integration-test/tests/document/mod.rs
Nathan.fooo b64da2c02f
refactor: File upload (#5542)
* chore: rename service

* refactor: upload

* chore: save upload meta data

* chore: add sql test

* chore: uploader

* chore: fix upload

* chore: cache file and remove after finish

* chore: retry upload

* chore: pause when netowork unreachable

* chore: add event test

* chore: add test

* chore: clippy

* chore: update client-api commit id

* chore: fix flutter test
2024-06-20 07:44:57 +08:00

26 lines
529 B
Rust

mod local_test;
mod af_cloud_test;
// #[cfg(feature = "supabase_cloud_test")]
// mod supabase_test;
use rand::{distributions::Alphanumeric, thread_rng, Rng};
pub fn generate_random_string(len: usize) -> String {
let rng = rand::thread_rng();
rng
.sample_iter(&Alphanumeric)
.take(len)
.map(char::from)
.collect()
}
pub fn generate_random_bytes(size: usize) -> Vec<u8> {
let s: String = thread_rng()
.sample_iter(&Alphanumeric)
.take(size)
.map(char::from)
.collect();
s.into_bytes()
}