Skip to content

Commit 272bfb1

Browse files
author
Abduqodiri Qurbonzoda
committed
Move quoted parameter value test from integration test to example project
1 parent d88068c commit 272bfb1

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

examples/kotlin-multiplatform/src/commonMain/kotlin/ParamBenchmark.kt

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,30 @@ import kotlin.math.*
88
@OutputTimeUnit(BenchmarkTimeUnit.MILLISECONDS)
99
@BenchmarkMode(Mode.Throughput)
1010
class ParamBenchmark {
11-
11+
1212
@Param("1", "2")
1313
var data = 0
1414

1515
@Param("1", "2")
1616
var value = 0
17-
18-
private lateinit var text : String
19-
20-
@Setup
21-
fun setUp() {
22-
text = "Hello!"
23-
}
24-
17+
18+
@Param("""a "string" with quotes""")
19+
var text: String = ""
20+
2521
@Benchmark
2622
fun mathBenchmark(): Double {
2723
return log(sqrt(data.toDouble()) * data, 2.0)
2824
}
29-
25+
3026
@Benchmark
3127
fun otherBenchmark(): Int {
3228
return data + data
3329
}
30+
31+
@Benchmark
32+
fun textContentCheck(): String {
33+
check(text.length == 22)
34+
check(text.count { it == '\"' } == 2)
35+
return text
36+
}
3437
}

integration/src/test/resources/templates/kotlin-multiplatform/src/commonMain/kotlin/CommonBenchmark.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import kotlin.math.*
88
@OutputTimeUnit(BenchmarkTimeUnit.MILLISECONDS)
99
@BenchmarkMode(Mode.Throughput)
1010
open class CommonBenchmark {
11-
@Param("""a "string" with quotes""")
12-
var value = ""
13-
1411
@Benchmark
1512
open fun mathBenchmark(): Double {
1613
return log(sqrt(3.0) * cos(3.0), 2.0)

0 commit comments

Comments
 (0)