Skip to content

Commit fac1457

Browse files
authored
Merge branch 'master' into patch-16
2 parents c96e9a0 + 14feeb7 commit fac1457

File tree

12 files changed

+23
-14
lines changed

12 files changed

+23
-14
lines changed

core-kotlin-modules/core-kotlin-advanced-3/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
- [Passing a Type to Generic Method in Kotlin](https://www.baeldung.com/kotlin/generic-methods)
55
- [Getting a Kotlin KClass from a Package Class Name String](https://www.baeldung.com/kotlin/kclass-fqn-string)
66
- [A Guide to Kotlin Context Receivers](https://www.baeldung.com/kotlin/context-receivers)
7+
- [A Guide to Kotlin’s Any, Unit, Nothing](https://www.baeldung.com/kotlin/any-unit-nothing-tutorial)
78
- More articles: [[<-- prev]](../core-kotlin-advanced-2)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Relevant Articles:
2+
3+
- [Kotlin Coroutine Continuation](https://www.baeldung.com/kotlin/coroutine-continuation)

core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/okio/BufferUnitTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test
66

77
class BufferUnitTest {
88
@Test
9-
fun readAndWriteStringWithLength() {
9+
fun `when writing data to a buffer then we can read the data back out` () {
1010
val input = "Hello, World!"
1111

1212
val buffer = Buffer()

core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/okio/ByteStringUnitTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test
88

99
class ByteStringUnitTest {
1010
@Test
11-
fun convertToFromUtf8() {
11+
fun `when converting a string to utf-8 bytes then we can convert back to a string` () {
1212
val byteString = "Hello".encodeUtf8()
1313

1414
assertEquals(5, byteString.size)
@@ -18,7 +18,7 @@ class ByteStringUnitTest {
1818
}
1919

2020
@Test
21-
fun convertToFromBase64() {
21+
fun `given a base64 input string when decoding as base64 then we get the correct string out` () {
2222
val byteString = "SGVsbG8=".decodeBase64()
2323

2424
assertEquals("Hello", byteString?.utf8())
@@ -27,7 +27,7 @@ class ByteStringUnitTest {
2727
}
2828

2929
@Test
30-
fun convertToFromHex() {
30+
fun `given a hex input string when decoding as hex then we get the correct string out` () {
3131
val byteString = "48656c6c6f".decodeHex()
3232

3333
assertEquals("Hello", byteString.utf8())
@@ -36,7 +36,7 @@ class ByteStringUnitTest {
3636
}
3737

3838
@Test
39-
fun convertToHash() {
39+
fun `given an input string when generating various hashes then we get the correct result` () {
4040
val byteString = "Hello".encodeUtf8()
4141

4242
assertEquals("8b1a9953c4611296a827abf8c47804d7", byteString.md5().hex())

core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/okio/FileSystemUnitTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import org.junit.jupiter.api.Test
99

1010
class FileSystemUnitTest {
1111
@Test
12-
fun test() {
12+
fun `given a filesystem when we list files then we find READMEmd` () {
1313
val files = FileSystem.SYSTEM.list(".".toPath())
1414
assertTrue(files.contains("README.md".toPath()))
1515
}
1616

1717
@Test
18-
fun readFile() {
18+
fun `given a filesystem when we read READMEmd then we get the correct first line` () {
1919
val line = FileSystem.SYSTEM.source("README.md".toPath()).buffer().readUtf8()
2020
assertEquals("## Core Kotlin I/O", line.lines().first())
2121
}

core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/okio/SinkUnitTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import kotlin.test.assertEquals
1111

1212
class SinkUnitTest {
1313
@Test
14-
fun testOutputStream() {
14+
fun `given an output stream when treating as a sink then we can write data to it` () {
1515
val inputBuffer = Buffer()
1616
inputBuffer.writeUtf8("Hello, World!")
1717

@@ -24,7 +24,7 @@ class SinkUnitTest {
2424
}
2525

2626
@Test
27-
fun testBufferedSink() {
27+
fun `given a sink when wrapping in a BufferedSink then we can write data to it` () {
2828
val outputStream = ByteArrayOutputStream()
2929
val sink = outputStream.sink().buffer()
3030
sink.writeUtf8("Hello, World!")
@@ -35,7 +35,7 @@ class SinkUnitTest {
3535
}
3636

3737
@Test
38-
fun testGzip() {
38+
fun `given a sink when wrapping in a GzipSink then we can compress data as we write it` () {
3939
val inputBuffer = Buffer()
4040
inputBuffer.writeUtf8("Hello, World!")
4141

core-kotlin-modules/core-kotlin-io/src/test/kotlin/com/baeldung/okio/SourceUnitTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import java.io.ByteArrayInputStream
88

99
class SourceUnitTest {
1010
@Test
11-
fun testInputStreamSource() {
11+
fun `given an input stream when treating as a source then we can read the data from it` () {
1212
val inputStream = ByteArrayInputStream("Hello, World!".encodeUtf8().toByteArray())
1313

1414
val source = inputStream.source()
@@ -21,7 +21,7 @@ class SourceUnitTest {
2121
}
2222

2323
@Test
24-
fun testBufferedSource() {
24+
fun `given a source when wrapping in a BufferedSource then we can read the data from it` () {
2525
val inputStream = ByteArrayInputStream("Hello, World!".encodeUtf8().toByteArray())
2626

2727
val source = inputStream.source().buffer()
@@ -30,7 +30,7 @@ class SourceUnitTest {
3030
}
3131

3232
@Test
33-
fun testGzipSource() {
33+
fun `given a source of compressed data when wrapping in a GzipSource then we can read the data from it` () {
3434
val inputBuffer = Buffer()
3535
inputBuffer.writeUtf8("Hello, World!")
3636

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
### Relevant Articles
22

33
- [Iterating All Fields of a Data Class Without Reflection in Kotlin](https://www.baeldung.com/kotlin/data-class-get-fields-no-reflection)
4+
- [Iterating Enum Entries in Kotlin](https://www.baeldung.com/kotlin/enum-iterate-entries)

k2-compiler/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
### Relevant Articles
22
- [K2 Compiler Migration Guide](https://www.baeldung.com/kotlin/k2-compiler-migration-tutorial)
3+
- [Kotlin K2 Compiler Overview](https://www.baeldung.com/kotlin/k2-compiler-guide)

kotlin-libraries-data/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ This module contains articles about data manipulation libraries topics in Kotlin
55
- [Class Inheritance with Kotlinx Serialization](https://www.baeldung.com/kotlin/kotlinx-serialization-inheritance)
66
- [Mapstruct With Kotlin’s Data Classes](https://www.baeldung.com/kotlin/mapstruct-data-classes)
77
- [Deserialize Enum While Ignoring Unknown Values in Kotlin](https://www.baeldung.com/kotlin/unknown-enums-deserialization)
8+
- [Serialize Enum in Retrofit With Kotlin](https://www.baeldung.com/kotlin/retrofit-enum)

0 commit comments

Comments
 (0)