This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.currytree | |
import androidx.compose.foundation.layout.PaddingValues | |
import androidx.compose.runtime.MutableState | |
import androidx.compose.runtime.mutableStateOf | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.text.AnnotatedString | |
import androidx.compose.ui.text.SpanStyle | |
import androidx.compose.ui.text.font.FontFamily | |
import androidx.compose.ui.text.font.FontStyle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Can't say this here, business doesn't know Node | |
class BlockFactory { | |
fun nodeFor(block:TextBlock):Node { | |
Make the correct node given that it's a text block and return it. | |
} | |
fun nodeFor(block:TodoBlock):Node { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun makeBuildString(properties: Properties): String { | |
val build = project.properties["BUILD"] | |
if (build == null) return "0-DEV" | |
val numeric_build = Integer.valueOf(build.toString()) | |
val numeric_minor_offset = Integer.valueOf(properties["minor_offset"].toString()) | |
val trueBuild = numeric_build - numeric_minor_offset | |
return "$trueBuild-RELEASE" | |
} | |
tasks.register("generateVersionString") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestTimerFactory : TimerFactory, Timer { | |
var tick: (now: Long) -> Unit = {} | |
override fun makeTimer(tick: (now: Long) -> Unit): Timer { | |
this.tick = tick | |
return this | |
} | |
override fun start() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.geepawhill.admin | |
import org.apache.commons.io.FileUtils | |
import java.nio.file.Files | |
import java.nio.file.Path | |
class ContentFolder(val root: Path) { | |
operator fun get(first: String, vararg parts: String): String { | |
val resolvedPath = root.resolve(Path.of(first, *parts)) | |
return this[resolvedPath] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
label { | |
selectorAs("check-label") { | |
padding.top += 20.px | |
font_size += 30.px | |
color += white | |
float += right | |
line_height += 80.px | |
margin.right += 40.px | |
declarations["cursor"] = "pointer" | |
display += block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val page = HtmlPageDelegate.page { | |
head { | |
stylesheet { | |
selector("*") { | |
display += block | |
} | |
} | |
} | |
body { | |
div("stinky") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.assertj.core.api.Assertions.assertThat | |
import org.junit.jupiter.api.Test | |
import kotlin.reflect.KClass | |
import kotlin.reflect.full.isSuperclassOf | |
/* | |
Marker interface. Anything that's a message can be sent across the wire. | |
*/ | |
interface Message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `sulfuras never changes`() { | |
assertBeforeAndAfter(SULFURUS_NAME, Int.MAX_VALUE, 80, Int.MAX_VALUE,80) | |
} | |
@Test | |
fun `sulfuras never changes even with weird values`() { | |
// NOTE: Gilded rose does not enforce quality or sellin for sulfuras | |
assertBeforeAndAfter(SULFURUS_NAME,-1,-3,-1,-3) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
fun `sulfuras never changes`() { | |
val item = updateQuality(Item(SULFURUS_NAME, Int.MAX_VALUE, 80)) | |
with(item) { | |
assertThat(name).isEqualTo(SULFURUS_NAME) | |
assertThat(sellIn).isEqualTo(Int.MAX_VALUE) | |
assertThat(quality).isEqualTo(80) | |
} | |
} |
NewerOlder