mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 08:07:48 +01: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
|
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
|
@Test
|
||||||
fun `Test Flag plus operator (LibrarySort)`() {
|
fun `Test Flag plus operator (LibrarySort)`() {
|
||||||
val current = LibrarySort(LibrarySort.Type.LastRead, LibrarySort.Direction.Ascending)
|
val current = LibrarySort(LibrarySort.Type.LastRead, LibrarySort.Direction.Ascending)
|
||||||
|
@ -36,33 +27,27 @@ class LibraryFlagsTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Test Flag plus operator`() {
|
fun `Test Flag plus operator`() {
|
||||||
val display = LibraryDisplayMode.CoverOnlyGrid
|
|
||||||
val sort = LibrarySort(LibrarySort.Type.DateAdded, LibrarySort.Direction.Ascending)
|
val sort = LibrarySort(LibrarySort.Type.DateAdded, LibrarySort.Direction.Ascending)
|
||||||
val flag = display + sort
|
|
||||||
|
|
||||||
flag shouldBe 0b01011111
|
sort.flag shouldBe 0b01011100
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Test Flag plus operator with old flag as base`() {
|
fun `Test Flag plus operator with old flag as base`() {
|
||||||
val currentDisplay = LibraryDisplayMode.List
|
|
||||||
val currentSort = LibrarySort(LibrarySort.Type.UnreadCount, LibrarySort.Direction.Descending)
|
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 sort = LibrarySort(LibrarySort.Type.DateAdded, LibrarySort.Direction.Ascending)
|
||||||
val flag = currentFlag + display + sort
|
val flag = currentSort.flag + sort
|
||||||
|
|
||||||
currentFlag shouldBe 0b00001110
|
flag shouldBe 0b01011100
|
||||||
flag shouldBe 0b01011111
|
flag shouldNotBe currentSort.flag
|
||||||
flag shouldNotBe currentFlag
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `Test default flags`() {
|
fun `Test default flags`() {
|
||||||
val sort = LibrarySort.default
|
val sort = LibrarySort.default
|
||||||
val display = LibraryDisplayMode.default
|
val flag = sort.type + sort.direction
|
||||||
val flag = display + sort.type + sort.direction
|
|
||||||
|
|
||||||
flag shouldBe 0b01000000
|
flag shouldBe 0b01000000
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue