Skip to content

Commit

Permalink
added reproduction for akkadotnet#4199
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronontheweb committed Feb 11, 2020
1 parent fc11431 commit a78844d
Showing 1 changed file with 19 additions and 1 deletion.
Expand Up @@ -153,7 +153,7 @@ public void Bugfix_4198_PNCounterMapDeltas_must_merge_other_PNCounterMaps()
dataEnvelope = dataEnvelope.WithData(withDelta.Zero.MergeDelta(withDelta));
}

// Bug: this is now an ORDictionary<string, PNCounter> under #4198
// Bug: this is was an ORDictionary<string, PNCounter> under #4198
var storedData = dataEnvelope.Data;

// simulate merging an update
Expand All @@ -168,5 +168,23 @@ public void Bugfix_4198_PNCounterMapDeltas_must_merge_other_PNCounterMaps()

m3.Entries.ShouldBeEquivalentTo(expected);
}

/// <summary>
/// Bug reproduction: https://github.com/akkadotnet/akka.net/issues/4199
/// </summary>
[Fact]
public void Bugfix_4199_PNCounterMaps_must_support_pruning()
{
var m1 = PNCounterDictionary<string>.Empty
.Increment(_node1, "a", 1)
.Increment(_node1, "b", 3)
.Increment(_node1, "c", 2)
.Increment(_node2, "a", 2);

m1.Entries["a"].ShouldBe(3);

var p1 = m1.Prune(_node2, _node1);
p1.Entries["a"].ShouldBe(m1.Entries["a"]); // values should be merged after pruning
}
}
}

0 comments on commit a78844d

Please sign in to comment.