Skip to content

Commit

Permalink
Add failing test case for reconciling enums between different variants
Browse files Browse the repository at this point in the history
  • Loading branch information
bluebear94 committed Mar 24, 2023
1 parent b7220cd commit 198d757
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions autosurgeon-derive/tests/reconcile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,29 @@ fn reconcile_tuple_enum_key() {
);
}

#[test]
fn reconcile_between_enum_variants() {
let mut doc = automerge::AutoCommit::new();
let temp = TempReading::Celsius("one".to_string(), 1.2);
reconcile_prop(&mut doc, automerge::ROOT, "temp", &temp).unwrap();

let temp = TempReading::Fahrenheit("three".to_string(), 6.7);
reconcile_prop(&mut doc, automerge::ROOT, "temp", &temp).unwrap();

assert_doc!(
doc.document(),
map! {
"temp" => { map! {
"Fahrenheit" => { list! {
{ "three" },
{ 6.7_f64 },
} }
}
}
}
);
}

mod enumkeyvisibility {
use autosurgeon::Reconcile;

Expand Down

0 comments on commit 198d757

Please sign in to comment.