aboutsummaryrefslogtreecommitdiff
path: root/wrms_test.go
Commit message (Collapse)AuthorAgeFilesLines
* fix broken indices in songs after Playlist.OrderedList()Florian Fischer2023-08-081-2/+30
| | | | | | | | | | 04205039f24ea6e71d2ce94c7cb7e1395f95179e was not enough to fix the ordered list issue introduced by 26f0033ebb5f8e7c204a042709e3dfa885eac868. heap.Pop uses Swap internally which modifies as songs index. We fix the broken indices by overriding them after the ordered list was created.
* make time bonus config value usable through yamlFlorian Fischer2023-07-311-1/+1
|
* use Logf() instead of Log(fmt.Sprintf())Florian Fischer2023-07-311-2/+2
|
* implement LoadPlaylist for mockPlayerFlorian Fischer2023-07-311-0/+1
|
* fix applyTimeBonus by always using Song pointersFlorian Fischer2023-07-221-12/+30
| | | | | | | | | | | Storing song objects in the Songs slice and using pointers to the underlying array slots breaks if the underlying array must be grown. When the array is grown the objects are copied to the new array and the pointers used in queue point to the old objects. This causes that Playlist.applyTimeBonus may not correctly apply to the most recent list of songs. This is fixed by always using Song pointers.
* add test for flipping a voteFlorian Fischer2023-07-221-0/+17
|
* implement playlist in order traversalFlorian Fischer2023-07-211-8/+34
| | | | This ensures that the initial reported song array is in order.
* add double add testFlorian Fischer2023-07-021-0/+15
|
* add simple wrms testFlorian Fischer2023-07-011-0/+85