Skip to content

Commit

Permalink
Add kotlinx.html test script to script with deps example
Browse files Browse the repository at this point in the history
  • Loading branch information
ligee committed Dec 8, 2021
1 parent c5a211e commit 37b26ef
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ class ResolveTest {
)
}

@Test
fun testKotlinxHtml() {
val res = evalFile(File("testData/hello-kotlinx-html.scriptwithdeps.kts"))

Assert.assertTrue(
"test failed:\n ${res.reports.joinToString("\n ") { it.message + if (it.exception == null) "" else ": ${it.exception}" }}",
res is ResultWithDiagnostics.Success
)
}

@Test
fun testUnresolvedJunit() {
val res = evalFile(File("testData/hello-unresolved-junit.scriptwithdeps.kts"))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@file:Repository("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
@file:DependsOn("org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.3")

import kotlinx.html.*; import kotlinx.html.stream.*; import kotlinx.html.attributes.*

val addressee = "World"

print(
createHTML().html {
body {
h1 { +"Hello, $addressee!" }
}
}
)

0 comments on commit 37b26ef

Please sign in to comment.