From 4a7cfd1a6cc63a95140c03a937c9f607303e1a57 Mon Sep 17 00:00:00 2001 From: XiangRongLin <41164160+XiangRongLin@users.noreply.github.com> Date: Tue, 18 Jan 2022 18:36:43 +0100 Subject: [PATCH] Ensure order of search history entries in tests --- .../newpipe/local/history/HistoryRecordManagerTest.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt b/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt index 15e88b09e..1bac3d101 100644 --- a/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt +++ b/app/src/androidTest/java/org/schabi/newpipe/local/history/HistoryRecordManagerTest.kt @@ -53,11 +53,12 @@ class HistoryRecordManagerTest { @Test fun deleteSearchHistory() { + val now = OffsetDateTime.now() val entries = listOf( - SearchHistoryEntry(OffsetDateTime.now(), 0, "A"), - SearchHistoryEntry(OffsetDateTime.now(), 2, "A"), - SearchHistoryEntry(OffsetDateTime.now(), 1, "B"), - SearchHistoryEntry(OffsetDateTime.now(), 0, "B"), + SearchHistoryEntry(now.minusSeconds(1), 0, "A"), + SearchHistoryEntry(now.minusSeconds(2), 2, "A"), + SearchHistoryEntry(now.minusSeconds(3), 1, "B"), + SearchHistoryEntry(now.minusSeconds(4), 0, "B"), ) // make sure all 4 were inserted