mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-23 13:23:28 +03:00
Fix LibraryFlagsTest
Forgot to update these after LibraryDisplayMode was made to not be a flag.
This commit is contained in:
parent
841f80f935
commit
0d9f8e8743
1 changed files with 6 additions and 21 deletions
|
@ -16,15 +16,6 @@ class LibraryFlagsTest {
|
|||
LibrarySort.directions.size shouldBe 2
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test Flag plus operator (LibraryDisplayMode)`() {
|
||||
val current = LibraryDisplayMode.List
|
||||
val new = LibraryDisplayMode.CoverOnlyGrid
|
||||
val flag = current + new
|
||||
|
||||
flag shouldBe 0b00000011
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test Flag plus operator (LibrarySort)`() {
|
||||
val current = LibrarySort(LibrarySort.Type.LastRead, LibrarySort.Direction.Ascending)
|
||||
|
@ -36,33 +27,27 @@ class LibraryFlagsTest {
|
|||
|
||||
@Test
|
||||
fun `Test Flag plus operator`() {
|
||||
val display = LibraryDisplayMode.CoverOnlyGrid
|
||||
val sort = LibrarySort(LibrarySort.Type.DateAdded, LibrarySort.Direction.Ascending)
|
||||
val flag = display + sort
|
||||
|
||||
flag shouldBe 0b01011111
|
||||
sort.flag shouldBe 0b01011100
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test Flag plus operator with old flag as base`() {
|
||||
val currentDisplay = LibraryDisplayMode.List
|
||||
val currentSort = LibrarySort(LibrarySort.Type.UnreadCount, LibrarySort.Direction.Descending)
|
||||
val currentFlag = currentDisplay + currentSort
|
||||
currentSort.flag shouldBe 0b00001100
|
||||
|
||||
val display = LibraryDisplayMode.CoverOnlyGrid
|
||||
val sort = LibrarySort(LibrarySort.Type.DateAdded, LibrarySort.Direction.Ascending)
|
||||
val flag = currentFlag + display + sort
|
||||
val flag = currentSort.flag + sort
|
||||
|
||||
currentFlag shouldBe 0b00001110
|
||||
flag shouldBe 0b01011111
|
||||
flag shouldNotBe currentFlag
|
||||
flag shouldBe 0b01011100
|
||||
flag shouldNotBe currentSort.flag
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test default flags`() {
|
||||
val sort = LibrarySort.default
|
||||
val display = LibraryDisplayMode.default
|
||||
val flag = display + sort.type + sort.direction
|
||||
val flag = sort.type + sort.direction
|
||||
|
||||
flag shouldBe 0b01000000
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue