Shuffle identical values in filtered deck sort (#3259)

* Shuffle identical values in filtered deck sort

* Update test
This commit is contained in:
Abdo 2024-06-28 14:53:16 +03:00 committed by GitHub
parent 6232d0aec8
commit 55d68c01d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View File

@ -724,7 +724,6 @@ def test_preview():
note["Front"] = "one" note["Front"] = "one"
col.addNote(note) col.addNote(note)
c = note.cards()[0] c = note.cards()[0]
orig = copy.copy(c)
note2 = col.newNote() note2 = col.newNote()
note2["Front"] = "two" note2["Front"] = "two"
col.addNote(note2) col.addNote(note2)
@ -757,10 +756,6 @@ def test_preview():
assert c2.reps == 0 assert c2.reps == 0
assert c2.type == CARD_TYPE_NEW assert c2.type == CARD_TYPE_NEW
# the other card should appear again
c = col.sched.getCard()
assert c.id == orig.id
# emptying the filtered deck should restore card # emptying the filtered deck should restore card
col.sched.empty_filtered_deck(did) col.sched.empty_filtered_deck(did)
c.load() c.load()

View File

@ -46,5 +46,5 @@ then (ivl / cast({today}-due+0.001 as real)) else 100000+due end)",
} }
}; };
format!("{} limit {}", order, term.limit) format!("{}, fnvhash(c.id, c.mod) limit {}", order, term.limit)
} }