1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-11-08 11:13:00 +00:00

Refactor database migration test and string trimming

This commit is contained in:
Yingwei Zheng
2022-05-04 20:20:19 +08:00
committed by TobiGr
parent 4af5b5f6f2
commit 881d04ba1e
2 changed files with 22 additions and 18 deletions

View File

@@ -28,9 +28,6 @@ class DatabaseMigrationTest {
private const val DEFAULT_SECOND_SERVICE_ID = 1
private const val DEFAULT_SECOND_URL = "https://www.youtube.com/watch?v=ncQU6iBn5Fc"
private const val DEFAULT_SEARCH1 = " abc "
private const val DEFAULT_SEARCH2 = " abc"
}
@get:Rule
@@ -163,28 +160,28 @@ class DatabaseMigrationTest {
"search_history", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
put("service_id", DEFAULT_SERVICE_ID)
put("search", DEFAULT_SEARCH1)
put("search", defaultSearch1)
}
)
insert(
"search_history", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
put("service_id", DEFAULT_SERVICE_ID)
put("search", DEFAULT_SEARCH2)
put("search", defaultSearch2)
}
)
insert(
"search_history", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
put("service_id", DEFAULT_SECOND_SERVICE_ID)
put("search", DEFAULT_SEARCH1)
put("search", defaultSearch1)
}
)
insert(
"search_history", SQLiteDatabase.CONFLICT_FAIL,
ContentValues().apply {
put("service_id", DEFAULT_SECOND_SERVICE_ID)
put("search", DEFAULT_SEARCH2)
put("search", defaultSearch2)
}
)
close()