itch.io: platform and tag filters (#1497)

This commit is contained in:
FX1922 authored and GitHub committed 2026-10-24 13:39:57 -04:00
1 parent 8d66570d33
commit 7b518d7e6a
38 files changed
+198 -3

No files matched your search

@@ -52,6 +52,25 @@ class ItchBrowseTest {
assertEquals("pixel-art", ItchBrowse.tagSlug(" Pixel Art "))
}
@Test fun aSortAPricePlatformAndTagCombineInThatOrder() {
assertEquals(
"https://itch.io/games/top-rated/free/platform-windows/tag-pixel-art.xml",
ItchBrowse.url(BrowseQuery(ItchBrowse.SORT_TOP_RATED, ItchBrowse.PRICE_FREE, setOf("windows"), listOf("pixel-art")), 1),
)
}
@Test fun severalPlatformsAndTagsAreAllInTheAddress() {
assertEquals(
"https://itch.io/games/platform-windows/platform-linux/tag-pixel-art/tag-2d",
path(platforms = setOf("linux", "windows"), tags = listOf("pixel-art", "2d")),
)
}
@Test fun aTypedTagBecomesItsSlug() {
assertEquals("visual-novel", ItchBrowse.tagSlug("Visual Novel!"))
assertEquals("", ItchBrowse.tagSlug(" !! "))
}
@Test fun theSamePlatformsInAnyOrderGiveTheSameAddress() {
assertEquals(path(platforms = setOf("web", "linux")), path(platforms = setOf("linux", "web")))
}