Fix LibraryFlagsTest

Forgot to update these after LibraryDisplayMode was made to not be a flag.
This commit is contained in:
arkon 2023-06-09 22:59:06 -04:00
parent 841f80f935
commit 0d9f8e8743

View file

@ -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
} }