Skip to content

Commit 3435e42

Browse files
committed
Merge branch 'main' into feat_row_expand
2 parents 518d111 + 5e8c890 commit 3435e42

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

shared-lib/Cargo.lock

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

shared-lib/flowy-user-data-model/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ lib-infra = { path = "../lib-infra", features = ["protobuf_file_gen"] }
2424
[dev-dependencies]
2525
quickcheck = "1.0.3"
2626
quickcheck_macros = "0.9.1"
27-
fake = "~2.3.0"
27+
fake = "2.4.3"
2828
claim = "0.4.0"
2929
futures = "0.3.15"
3030
serial_test = "0.5.1"
31+
rand_core = "0.6.3"
32+
rand = "0.8.5"
3133

3234
[features]
3335
dart = ["lib-infra/dart", "flowy-error-code/dart"]

shared-lib/flowy-user-data-model/src/parser/user_email.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ mod tests {
2929
use super::*;
3030
use claim::assert_err;
3131
use fake::{faker::internet::en::SafeEmail, Fake};
32+
use rand::prelude::StdRng;
33+
use rand_core::SeedableRng;
3234

3335
#[test]
3436
fn empty_string_is_rejected() {
@@ -52,8 +54,13 @@ mod tests {
5254
struct ValidEmailFixture(pub String);
5355

5456
impl quickcheck::Arbitrary for ValidEmailFixture {
55-
fn arbitrary<G: quickcheck::Gen>(g: &mut G) -> Self {
56-
let email = SafeEmail().fake_with_rng(g);
57+
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
58+
let mut rand_slice: [u8; 32] = [0; 32];
59+
for i in 0..32 {
60+
rand_slice[i] = u8::arbitrary(g);
61+
}
62+
let mut seed = StdRng::from_seed(rand_slice);
63+
let email = SafeEmail().fake_with_rng(&mut seed);
5764
Self(email)
5865
}
5966
}

0 commit comments

Comments
 (0)