[orx-composition, orx-svg] Move Composition and SVG code from OPENRNDR to ORX
This commit is contained in:
38
orx-composition/src/commonTest/kotlin/TestComposition.kt
Normal file
38
orx-composition/src/commonTest/kotlin/TestComposition.kt
Normal file
@@ -0,0 +1,38 @@
|
||||
package org.openrndr.extra.composition
|
||||
|
||||
import org.openrndr.shape.Shape
|
||||
import kotlin.test.*
|
||||
|
||||
class TestComposition {
|
||||
val composition = let { _ ->
|
||||
val root = GroupNode().also { it.id = "outer" }
|
||||
root.children += GroupNode().also {
|
||||
it.id = "inner"
|
||||
}
|
||||
root.children += ShapeNode(Shape.EMPTY).also {
|
||||
it.id = "shape"
|
||||
}
|
||||
Composition(root)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun findGroup() {
|
||||
assertEquals("outer", composition.findGroup("outer")?.id)
|
||||
assertEquals("inner", composition.findGroup("inner")?.id)
|
||||
assertNull(composition.findGroup("shape"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun findShape() {
|
||||
assertEquals("shape", composition.findShape("shape")?.id)
|
||||
assertNull(composition.findShape("inner"))
|
||||
assertNull(composition.findShape("outer"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun findImage() {
|
||||
assertNull(composition.findImage("inner"))
|
||||
assertNull(composition.findImage("outer"))
|
||||
assertNull(composition.findImage("shape"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user