[orx-shader-phrases] Add shader phrases tweaks (#196)

This commit is contained in:
Abe Pazos
2021-10-19 11:58:08 +02:00
committed by GitHub
parent dd750e58a0
commit 328e9c94f3
6 changed files with 135 additions and 24 deletions

View File

@@ -5,19 +5,23 @@ import org.openrndr.extra.shaderphrases.ShaderPhraseRegistry
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe
class TestShaderPhraseBookobject : Spek({
class TestShaderPhraseBook : Spek({
describe("A shader phrase book") {
val book = object:ShaderPhraseBook("testBook") {
val phrase = ShaderPhrase("""
|vec4 test_phrase() {
|}
""".trimMargin() )
val book = object : ShaderPhraseBook("testBook") {
val phrase = ShaderPhrase(
"""
vec4 test_phrase() {
}
""".trimMargin()
)
}
it("can be registered") {
book.register()
}
it("can be found") {
ShaderPhraseRegistry.findPhrase("testBook.test_phrase") `should be` book.phrase
ShaderPhraseRegistry.findPhrase(
"testBook.test_phrase"
) `should be` book.phrase
}
}
})