Updated README

This commit is contained in:
2020-01-11 00:55:15 +01:00
parent 38c3c268c0
commit 3e5401bd9d
2 changed files with 50 additions and 29 deletions

View File

@ -114,16 +114,31 @@ class TreeNodeTest {
@Test
fun kotlinExtTest() {
val root = treeNode("World") {
val root = TreeNode("World")
val northA = TreeNode("North America")
val europe = TreeNode("Europe")
root.addChild(northA)
root.addChild(europe)
val usa = TreeNode("USA")
northA.addChild(usa)
val poland = TreeNode("Poland")
val france = TreeNode("France")
europe.addChild(poland)
europe.addChild(france)
val rootExt = treeNode("World") {
treeNode("North America") {
treeNode("USA")
}
treeNode("Europe") {
treeNode("Poland")
treeNode("Germany")
treeNode("France")
}
}
println(root)
assertEquals(root.toString(), rootExt.toString())
}