Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Nashatyrev committed Aug 16, 2023
1 parent 777ccf0 commit e78160d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions libp2p/src/test/kotlin/io/libp2p/pubsub/SeenCacheTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ class LRUSeenCacheTest {
assertThat(backingCache.size).isEqualTo(0)
}



@Test
fun `test old entries are evicted`() {
val backingCache = SimpleSeenCache<String>()
Expand All @@ -143,20 +141,19 @@ class LRUSeenCacheTest {
lruCache[createPubsubMessage(3)] = "3"

assertThat(lruCache.size).isEqualTo(3)
assertContainsEntries(lruCache, 1, 2 ,3)
assertContainsEntries(lruCache, 1, 2, 3)

lruCache[createPubsubMessage(4)] = "4"

assertThat(lruCache.size).isEqualTo(3)
assertDoesntContainEntry(lruCache, 1)
assertContainsEntries(lruCache, 2, 3, 4)


lruCache[createPubsubMessage(5)] = "5"

assertThat(lruCache.size).isEqualTo(3)
assertDoesntContainEntries(lruCache, 1, 2)
assertContainsEntries(lruCache, 3, 4 ,5)
assertContainsEntries(lruCache, 3, 4, 5)

lruCache[createPubsubMessage(1)] = "1"

Expand Down

0 comments on commit e78160d

Please sign in to comment.