forked from github/wulkanowy-mirror
Merge branch 'release/0.21.2' into master
This commit is contained in:
commit
c362ad12c7
@ -14,7 +14,7 @@ cache:
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- develop
|
- develop
|
||||||
- 0.21.1
|
- 0.21.2
|
||||||
|
|
||||||
android:
|
android:
|
||||||
licenses:
|
licenses:
|
||||||
|
@ -18,8 +18,8 @@ android {
|
|||||||
testApplicationId "io.github.tests.wulkanowy"
|
testApplicationId "io.github.tests.wulkanowy"
|
||||||
minSdkVersion 17
|
minSdkVersion 17
|
||||||
targetSdkVersion 29
|
targetSdkVersion 29
|
||||||
versionCode 71
|
versionCode 72
|
||||||
versionName "0.21.1"
|
versionName "0.21.2"
|
||||||
multiDexEnabled true
|
multiDexEnabled true
|
||||||
resValue "string", "app_name", "Wulkanowy"
|
resValue "string", "app_name", "Wulkanowy"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
@ -127,7 +127,7 @@ configurations.all {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation "io.github.wulkanowy:sdk:0.21.1"
|
implementation "io.github.wulkanowy:sdk:0.21.2"
|
||||||
|
|
||||||
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.0.10'
|
||||||
|
|
||||||
|
@ -56,11 +56,11 @@ object PairAdapterFactory : JsonAdapter.Factory {
|
|||||||
private fun deserializeGsonPair(reader: JsonReader): List<Pair<String, String>>? {
|
private fun deserializeGsonPair(reader: JsonReader): List<Pair<String, String>>? {
|
||||||
val list = listAdapter.fromJson(reader) ?: return null
|
val list = listAdapter.fromJson(reader) ?: return null
|
||||||
|
|
||||||
require(list.size == 2 || list.isEmpty()) {
|
|
||||||
"pair with more or less than two elements: $list"
|
|
||||||
}
|
|
||||||
|
|
||||||
return list.map {
|
return list.map {
|
||||||
|
require(it.size == 2) {
|
||||||
|
"pair with more or less than two elements: $list"
|
||||||
|
}
|
||||||
|
|
||||||
it["first"].orEmpty() to it["second"].orEmpty()
|
it["first"].orEmpty() to it["second"].orEmpty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Wersja 0.21.1
|
Wersja 0.21.2
|
||||||
- naprawiliśmy logowanie do tarnowskiego dziennika
|
- naprawiliśmy logowanie do tarnowskiego dziennika
|
||||||
- naprawiliśmy wyświetlanie podsumowania punktów klasy
|
- naprawiliśmy wyświetlanie podsumowania punktów klasy
|
||||||
- dodaliśmy skróty aplikacji
|
- dodaliśmy skróty aplikacji
|
||||||
|
@ -7,19 +7,24 @@ class ConvertersTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun stringPairListToJson() {
|
fun stringPairListToJson() {
|
||||||
|
assertEquals(Converters().stringPairListToJson(listOf("aaa" to "bbb", "ccc" to "ddd", "eee" to "fff")), "[{\"first\":\"aaa\",\"second\":\"bbb\"},{\"first\":\"ccc\",\"second\":\"ddd\"},{\"first\":\"eee\",\"second\":\"fff\"}]")
|
||||||
assertEquals(Converters().stringPairListToJson(listOf("aaa" to "bbb", "ccc" to "ddd")), "[{\"first\":\"aaa\",\"second\":\"bbb\"},{\"first\":\"ccc\",\"second\":\"ddd\"}]")
|
assertEquals(Converters().stringPairListToJson(listOf("aaa" to "bbb", "ccc" to "ddd")), "[{\"first\":\"aaa\",\"second\":\"bbb\"},{\"first\":\"ccc\",\"second\":\"ddd\"}]")
|
||||||
|
assertEquals(Converters().stringPairListToJson(listOf("aaa" to "bbb")), "[{\"first\":\"aaa\",\"second\":\"bbb\"}]")
|
||||||
assertEquals(Converters().stringPairListToJson(listOf()), "[]")
|
assertEquals(Converters().stringPairListToJson(listOf()), "[]")
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun jsonToStringPairList() {
|
fun jsonToStringPairList() {
|
||||||
|
assertEquals(Converters().jsonToStringPairList("[{\"first\":\"aaa\",\"second\":\"bbb\"},{\"first\":\"ccc\",\"second\":\"ddd\"},{\"first\":\"eee\",\"second\":\"fff\"}]"), listOf("aaa" to "bbb", "ccc" to "ddd", "eee" to "fff"))
|
||||||
assertEquals(Converters().jsonToStringPairList("[{\"first\":\"aaa\",\"second\":\"bbb\"},{\"first\":\"ccc\",\"second\":\"ddd\"}]"), listOf("aaa" to "bbb", "ccc" to "ddd"))
|
assertEquals(Converters().jsonToStringPairList("[{\"first\":\"aaa\",\"second\":\"bbb\"},{\"first\":\"ccc\",\"second\":\"ddd\"}]"), listOf("aaa" to "bbb", "ccc" to "ddd"))
|
||||||
|
assertEquals(Converters().jsonToStringPairList("[{\"first\":\"aaa\",\"second\":\"bbb\"}]"), listOf("aaa" to "bbb"))
|
||||||
assertEquals(Converters().jsonToStringPairList("[]"), listOf<Pair<String, String>>())
|
assertEquals(Converters().jsonToStringPairList("[]"), listOf<Pair<String, String>>())
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun jsonToStringPairList_0210() {
|
fun jsonToStringPairList_0210() {
|
||||||
assertEquals(Converters().jsonToStringPairList("{\"aaa\":\"bbb\",\"ccc\":\"ddd\"}"), listOf("aaa" to "bbb", "ccc" to "ddd"))
|
assertEquals(Converters().jsonToStringPairList("{\"aaa\":\"bbb\",\"ccc\":\"ddd\"}"), listOf("aaa" to "bbb", "ccc" to "ddd"))
|
||||||
|
assertEquals(Converters().jsonToStringPairList("{\"aaa\":\"bbb\"}"), listOf("aaa" to "bbb"))
|
||||||
assertEquals(Converters().jsonToStringPairList("{}"), listOf<Pair<String, String>>())
|
assertEquals(Converters().jsonToStringPairList("{}"), listOf<Pair<String, String>>())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user