public void Merge2Test() { var heap1 = "c a b".Split().Aggregate(BootstrappedHeap <string> .Empty, (current, word) => BootstrappedHeap <string> .Insert(word, current)); var heap3 = BootstrappedHeap <string> .Merge(heap1, BootstrappedHeap <string> .Empty); Assert.AreSame(heap1, heap3); }
public void Merge3Test() { var heap1 = "c a b".Split().Aggregate(BootstrappedHeap <string> .Empty, (current, word) => BootstrappedHeap <string> .Insert(word, current)); var heap2 = "z x y".Split().Aggregate(BootstrappedHeap <string> .Empty, (current, word) => BootstrappedHeap <string> .Insert(word, current)); var heap3 = BootstrappedHeap <string> .Merge(heap1, heap2); Assert.AreEqual("[a: {[b: Empty]: {[c: Empty]: {[x: {[y: Empty]: {[z: Empty]: Empty}}]: Empty}}}]", DumpHeap(heap3)); }