Actually generate AppliedPatchSet objects (#250)

* Start actually computing AppliedPatchSet values

* Improve patch_apply documentation and flesh out applied patch code

* Add file link notes

* Stub out where tests for snapshot subsystem will go

* Create baseline tests

* Fix build failure by silencing Clippy
This commit is contained in:
Lucien Greathouse
2019-09-27 15:07:11 -07:00
committed by GitHub
parent a70b7ee150
commit e741f7b557
7 changed files with 190 additions and 33 deletions

View File

@@ -0,0 +1,35 @@
use std::borrow::Cow;
use rbx_dom_weak::RbxInstanceProperties;
use crate::snapshot::{compute_patch_set, InstancePropertiesWithMeta, InstanceSnapshot, RojoTree};
#[test]
fn reify_folder() {
let tree = empty_tree();
let folder = InstanceSnapshot {
snapshot_id: None,
metadata: Default::default(),
name: Cow::Borrowed("Some Folder"),
class_name: Cow::Borrowed("Folder"),
properties: Default::default(),
children: Vec::new(),
};
let _patch_set = compute_patch_set(&folder, &tree, tree.get_root_id());
// TODO: Make assertions about patch set using snapshots. This needs patches
// to be serializable and also to have ID redactions more readily available.
}
fn empty_tree() -> RojoTree {
RojoTree::new(InstancePropertiesWithMeta {
properties: RbxInstanceProperties {
name: "ROOT".to_owned(),
class_name: "ROOT".to_owned(),
properties: Default::default(),
},
metadata: Default::default(),
})
}