#[test]
fn readme_examples() {
use object_hash::{Options, Value, canonical_with, hash};
let one = Value::Map(vec![
("name".into(), Value::String("cipansor".into())),
("year".into(), Value::Number(2026.0)),
]);
let two = Value::Map(vec![
("year".into(), Value::Number(2026.0)),
("name".into(), Value::String("cipansor".into())),
]);
assert_eq!(hash(&one), hash(&two));
let object = Value::Object(vec![("a".into(), Value::number(1))]);
let map = Value::Map(vec![("a".into(), Value::number(1))]);
assert_ne!(hash(&object), hash(&map));
let keys = Value::Object(vec![
("a".into(), Value::number(1)),
("b".into(), Value::number(2)),
]);
assert_eq!(
canonical_with(&keys, &Options::keys()),
"object:2:string:1:a:,string:1:b:,"
);
}