Renamed Value to JsonValue to make things a little more clear

This commit is contained in:
Dave Hrycyszyn
2024-05-30 15:45:38 +01:00
parent 0733e12539
commit 3120ceee5d
7 changed files with 108 additions and 102 deletions

View File

@@ -1,7 +1,7 @@
use bft_json_crdt::{
keypair::make_author,
list_crdt::ListCrdt,
op::{Op, OpId, ROOT_ID}, json_crdt::{CrdtNode, Value},
op::{Op, OpId, ROOT_ID}, json_crdt::{CrdtNode, JsonValue},
};
use rand::{rngs::ThreadRng, seq::SliceRandom, Rng};
@@ -14,9 +14,9 @@ const TEST_N: usize = 100;
#[test]
fn test_list_fuzz_commutative() {
let mut rng = rand::thread_rng();
let mut op_log = Vec::<Op<Value>>::new();
let mut op_log1 = Vec::<Op<Value>>::new();
let mut op_log2 = Vec::<Op<Value>>::new();
let mut op_log = Vec::<Op<JsonValue>>::new();
let mut op_log1 = Vec::<Op<JsonValue>>::new();
let mut op_log2 = Vec::<Op<JsonValue>>::new();
let mut l1 = ListCrdt::<char>::new(make_author(1), vec![]);
let mut l2 = ListCrdt::<char>::new(make_author(2), vec![]);
let mut chk = ListCrdt::<char>::new(make_author(3), vec![]);
@@ -62,8 +62,8 @@ fn test_list_fuzz_commutative() {
assert_eq!(l2_doc, chk_doc);
// now, allow cross mixing between both
let mut op_log1 = Vec::<Op<Value>>::new();
let mut op_log2 = Vec::<Op<Value>>::new();
let mut op_log1 = Vec::<Op<JsonValue>>::new();
let mut op_log2 = Vec::<Op<JsonValue>>::new();
for _ in 0..TEST_N {
let letter1: char = rng.gen_range(b'a'..=b'z') as char;
let letter2: char = rng.gen_range(b'a'..=b'z') as char;