Skip to content

Commit 3f8a1b2

Browse files
committed
added @@language("kts") annotations
1 parent d5280cc commit 3f8a1b2

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

core/src/test/kotlin/org/jetbrains/kotlinx/dataframe/jupyter/JupyterCodegenTests.kt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
2626
""".trimIndent()
2727
)
2828
res1 shouldBe Unit
29+
30+
@Language("kts")
2931
val res2 = execRaw("df") as AnyFrame
3032

3133
res2["value"].type shouldBe typeOf<List<Any?>>()
@@ -126,6 +128,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
126128
)
127129
res1 shouldBe Unit
128130

131+
@Language("kts")
129132
val res2 = execRaw("df.`1`")
130133
res2.shouldBeInstanceOf<ValueColumn<*>>()
131134
}
@@ -141,6 +144,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
141144
)
142145
res1.shouldBeInstanceOf<MimeTypedResult>()
143146

147+
@Language("kts")
144148
val res2 = exec(
145149
"""listOf(df.`{a}`[0], df.`(b)`[0], df.`{c}`[0])"""
146150
)
@@ -157,6 +161,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
157161
""".trimIndent()
158162
)
159163
res1.shouldBeInstanceOf<MimeTypedResult>()
164+
165+
@Language("kts")
160166
val res2 = exec(
161167
"listOf(df.`\$id`[0])"
162168
)
@@ -174,6 +180,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
174180
)
175181
res1.shouldBeInstanceOf<MimeTypedResult>()
176182
println(res1.entries.joinToString())
183+
184+
@Language("kts")
177185
val res2 = exec(
178186
"listOf(df.`Day's`[0])"
179187
)
@@ -193,6 +201,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
193201
)
194202
res1.shouldBeInstanceOf<MimeTypedResult>()
195203
println(res1.entries.joinToString())
204+
205+
@Language("kts")
196206
val res2 = exec(
197207
"listOf(df.`Test `[0])"
198208
)
@@ -212,6 +222,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
212222
)
213223
res1.shouldBeInstanceOf<MimeTypedResult>()
214224
println(res1.entries.joinToString())
225+
226+
@Language("kts")
215227
val res2 = exec(
216228
"listOf(df.`Test `[0])"
217229
)
@@ -220,6 +232,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
220232

221233
@Test
222234
fun `generic interface`() {
235+
@Language("kts")
223236
val res1 = exec(
224237
"""
225238
@DataSchema
@@ -229,6 +242,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
229242
""".trimIndent()
230243
)
231244
res1.shouldBeInstanceOf<Unit>()
245+
246+
@Language("kts")
232247
val res2 = exec(
233248
"""
234249
val <T> ColumnsContainer<Generic<T>>.test1: DataColumn<T> get() = field
@@ -240,6 +255,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
240255

241256
@Test
242257
fun `generic interface with upper bound`() {
258+
@Language("kts")
243259
val res1 = exec(
244260
"""
245261
@DataSchema
@@ -249,6 +265,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
249265
""".trimIndent()
250266
)
251267
res1.shouldBeInstanceOf<Unit>()
268+
269+
@Language("kts")
252270
val res2 = exec(
253271
"""
254272
val <T : String> ColumnsContainer<Generic<T>>.test1: DataColumn<T> get() = field
@@ -260,6 +278,7 @@ class JupyterCodegenTests : JupyterReplTestCase() {
260278

261279
@Test
262280
fun `generic interface with variance and user type in type parameters`() {
281+
@Language("kts")
263282
val res1 = exec(
264283
"""
265284
interface UpperBound
@@ -271,6 +290,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
271290
""".trimIndent()
272291
)
273292
res1.shouldBeInstanceOf<Unit>()
293+
294+
@Language("kts")
274295
val res2 = exec(
275296
"""
276297
val <T : UpperBound> ColumnsContainer<Generic<T>>.test1: DataColumn<T> get() = field
@@ -282,7 +303,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
282303

283304
@Test
284305
fun `generate a new marker when dataframe marker is not a data schema so that columns are accessible with extensions`() {
285-
exec(
306+
@Language("kts")
307+
val a = exec(
286308
"""
287309
enum class State {
288310
Idle, Productive, Maintenance
@@ -305,7 +327,8 @@ class JupyterCodegenTests : JupyterReplTestCase() {
305327
""".trimIndent()
306328
)
307329
shouldNotThrowAny {
308-
exec(
330+
@Language("kts")
331+
val b = exec(
309332
"""
310333
events.toolId
311334
events.state

0 commit comments

Comments
 (0)