Skip to content

Commit ca2e8ab

Browse files
author
Simon Schubert
committed
DFix test
1 parent f663c62 commit ca2e8ab

File tree

7 files changed

+9
-10
lines changed

7 files changed

+9
-10
lines changed

android/src/androidTest/java/com/inspiredandroid/linuxcommandbibliotheca/ComposeTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ComposeTests {
103103
composeTestRule.onNodeWithContentDescription("TopAppBarTitle")
104104
.assertTextEquals(firstBasicCategory.title)
105105

106-
val basicGroup = databaseHelper.getBasicGroups(firstBasicCategory.id).first()
106+
val basicGroup = databaseHelper.getBasicGroupsByQuery(firstBasicCategory.id).first()
107107

108108
// Click on first group
109109
composeTestRule.onNodeWithText(basicGroup.description).performClick()

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/ui/screens/basicgroups/BasicGroupsViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BasicGroupsViewModel(categoryId: Long) : ViewModel() {
2323

2424
private val collapsedMap = mutableStateMapOf<Long, Boolean>()
2525

26-
var basicGroups = databaseHelper.getBasicGroups(categoryId)
26+
var basicGroups = databaseHelper.getBasicGroupsByQuery(categoryId)
2727

2828
fun isGroupCollapsed(id: Long): Boolean = collapsedMap[id] == true
2929

android/src/main/java/com/inspiredandroid/linuxcommandbibliotheca/ui/screens/search/SearchViewModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class SearchViewModel : ViewModel() {
4040
ensureActive()
4141

4242
val commands = databaseHelper.getCommandsByQuery(searchText).sortedSearch(searchText)
43-
val basicGroups = databaseHelper.getBasicGroups(searchText)
43+
val basicGroups = databaseHelper.getBasicGroupsByQuery(searchText)
4444

4545
ensureActive()
4646

cli/src/main/kotlin/com/linuxcommandlibrary/cli/ConsoleApplication.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fun showBasicCategories() {
120120
}
121121

122122
fun showBasicGroups(id: Long) {
123-
databaseHelper.getBasicGroups(id).forEach { group ->
123+
databaseHelper.getBasicGroupsByQuery(id).forEach { group ->
124124
println("$BOLD${group.description}$RESET")
125125
databaseHelper.getBasicCommands(group.id).forEach { command ->
126126
println("- " + command.command)

common/src/commonMain/kotlin/com/linuxcommandlibrary/shared/Platform.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ class DatabaseHelper {
4747

4848
fun getBasics(): List<BasicCategory> = commandQueries.selectBasicCategories().executeAsList()
4949

50-
fun getBasicGroups(categoryId: Long): List<BasicGroup> = commandQueries.selectBasicGroupByCategory(categoryId).executeAsList()
50+
fun getBasicGroupsByQuery(categoryId: Long): List<BasicGroup> = commandQueries.selectBasicGroupByCategory(categoryId).executeAsList()
5151

5252
fun getBasicCommands(groupId: Long): List<BasicCommand> = commandQueries.selectBasicCommandByGroupId(groupId).executeAsList()
5353

54-
fun getBasicGroups(query: String): List<BasicGroup> = commandQueries.selectBasicGroupsByQuery(query).executeAsList()
54+
fun getBasicGroupsByQuery(query: String): List<BasicGroup> = commandQueries.selectBasicGroupsByQuery(query).executeAsList()
5555

5656
fun getSections(commandId: Long): List<CommandSection> = commandQueries.selectCommandSectionsByCommandId(commandId).executeAsList()
5757

common/src/commonTest/kotlin/CommonTests.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import com.linuxcommandlibrary.shared.CommandElement
22
import com.linuxcommandlibrary.shared.getCommandList
33
import com.linuxcommandlibrary.shared.getHtmlFileName
44
import com.linuxcommandlibrary.shared.getSortPriority
5-
import com.linuxcommandlibrary.shared.search
5+
import com.linuxcommandlibrary.shared.sortedSearch
66
import databases.BasicCategory
77
import databases.Command
88
import databases.CommandSection
@@ -22,14 +22,13 @@ class CommonTests {
2222
@Test
2323
fun testCommandListSearch() {
2424
val commands = listOf(
25-
Command(0, 0, "img2webp", "convert image to webp"),
2625
Command(0, 0, "optipng", "convert"),
2726
Command(0, 0, "thumbnail", "take png and do something"),
2827
Command(0, 0, "Pngcheck", "print detailed"),
2928
Command(0, 0, "png", "png"),
3029
)
3130

32-
val filteredCommands = commands.search("png")
31+
val filteredCommands = commands.sortedSearch("png")
3332

3433
assert(filteredCommands.size == 4)
3534

desktop/src/main/kotlin/com/linuxcommandlibrary/desktop/WebsiteBuilder.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ class WebsiteBuilder {
268268
basicCategories.forEachIndexed { index, category ->
269269
print("\rCreate basic category html ${index + 1}/$totalCount")
270270

271-
val groups = databaseHelper.getBasicGroups(category.id)
271+
val groups = databaseHelper.getBasicGroupsByQuery(category.id)
272272

273273
val file = File(folder, "${category.getHtmlFileName()}.html")
274274
file.delete()

0 commit comments

Comments
 (0)