Skip to content

Commit

Permalink
Add forgotten fieldOrigin extension function test
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattking committed Jul 29, 2024
1 parent 2b9a606 commit 7acc7eb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/kotlin/info/mking/k2zpl/command/FieldOriginTest.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package info.mking.k2zpl.command

import info.mking.k2zpl.command.options.ZplJustification
import info.mking.k2zpl.k2zpl
import info.mking.k2zpl.testBuildString
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.IsolationMode
Expand Down Expand Up @@ -43,4 +44,18 @@ class FieldOriginTest : DescribeSpec({
}
}
}
describe("fieldOrigin extension function") {
it("outputs correct command") {
val result = k2zpl {
fieldOrigin(x = 10, y = 10, justification = ZplJustification.RIGHT)
}
result shouldBe "^FO10,10,1\n"
}
it("outputs correct command with default parameters") {
val result = k2zpl {
fieldOrigin(x = 20, y = 20)
}
result shouldBe "^FO20,20,0\n"
}
}
})

0 comments on commit 7acc7eb

Please sign in to comment.