mod common;
use common::*;
#[test]
fn empty_path_with_updater_returns_root_unchanged() {
let from = arr(vec![n(0.0), n(1.0)]);
let actual = run(from.clone(), &[], |v| match v {
simple_update_in::Value::Array(items) => {
let mut next = (*items).clone();
next.push(n(2.0));
arr(next)
}
other => other,
});
assert!(from.ptr_eq(&actual));
assert_eq!(actual, arr(vec![n(0.0), n(1.0)]));
}
#[test]
fn empty_path_without_updater_returns_root_unchanged() {
let from = obj(vec![("a", n(1.0))]);
let actual = remove(from.clone(), &[]);
assert!(from.ptr_eq(&actual));
assert_eq!(actual, obj(vec![("a", n(1.0))]));
}