moved the stdlib tests into the same directory as the stdlib, so it works a bit better with maven support in IDEA

This commit is contained in:
James Strachan
2012-03-14 16:14:04 +00:00
parent 9cd21d3a4d
commit 7ef65c0099
35 changed files with 2 additions and 2 deletions
+39
View File
@@ -0,0 +1,39 @@
package test.dom
import kotlin.*
import kotlin.dom.*
import kotlin.test.*
import org.w3c.dom.*
import junit.framework.TestCase
class DomTest() : TestCase() {
fun testCreateDocument() {
var doc = createDocument()
assertNotNull(doc, "Should have created a document")
val e = doc.createElement("foo").sure()
assertCssClass(e, "")
// now lets update the cssClass property
e.classes = "foo"
assertCssClass(e, "foo")
// now using the attribute directly
e.setAttribute("class", "bar")
assertCssClass(e, "bar")
doc += e
println("document ${doc.toXmlString()}")
}
fun assertCssClass(e: Element, value: String?): Unit {
val cl = e.classes
val cl2 = e.getAttribute("class")
println("element ${e.toXmlString()} has cssClass `${cl}` class attr `${cl2}`")
assertEquals(value, cl, "value of element.cssClass")
assertEquals(value, cl2, "value of element.getAttribute(\"class\")")
}
}