From 1b2779ff09d0c2407d7ae0c62401d759231ea361 Mon Sep 17 00:00:00 2001 From: bryan newbold Date: Wed, 15 Feb 2023 19:31:41 -0800 Subject: pds: mst: add empty layer nodes as needed This is to match behavior of the upstream Javascript implementation. Basically, if there is a "layer=2" node and a "layer=0" node, and no other nodes, there should be a "layer=1" node in between with just the 'left' reference populated. --- adenosine-pds/tests/test_mst_interop.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'adenosine-pds/tests') diff --git a/adenosine-pds/tests/test_mst_interop.rs b/adenosine-pds/tests/test_mst_interop.rs index af03fd7..8a5becc 100644 --- a/adenosine-pds/tests/test_mst_interop.rs +++ b/adenosine-pds/tests/test_mst_interop.rs @@ -3,7 +3,6 @@ use libipld::Cid; use std::collections::BTreeMap; use std::str::FromStr; -#[ignore] #[test] fn test_known_maps() { let mut repo = RepoStore::open_ephemeral().unwrap(); @@ -42,6 +41,7 @@ fn test_known_maps() { ); } +// TODO: behavior of these wide-char keys is undefined behavior in string MST #[ignore] #[test] fn test_tricky_map() { @@ -72,7 +72,6 @@ fn test_trims_top() { let l1root = "bafyreihuyj2vzb2vjw3yhxg6dy25achg5fmre6gg5m6fjtxn64bqju4dee"; let l0root = "bafyreibmijjc63mekkjzl3v2pegngwke5u6cu66g75z6uw27v64bc6ahqi"; - // NOTE: this test doesn't do much in this case of rust implementation let mut trim_map: BTreeMap = Default::default(); trim_map.insert("com.example.record/40c73105b48f".to_string(), cid1.clone()); // level 0 @@ -123,7 +122,6 @@ fn test_insertion() { assert_eq!(insertion_after_cid.to_string(), l2root); } -#[ignore] #[test] fn test_higher_layers() { // "handles new layers that are two higher than existing" -- cgit v1.2.3