-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move graphicField extension function, add empty GraphicFieldTest file…
…, will add more tests later upon further investigation. Also add suppression of UNUSED on all option class files
- Loading branch information
1 parent
7acc7eb
commit bb78aeb
Showing
4 changed files
with
72 additions
and
21 deletions.
There are no files selected for viewing
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
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
13 changes: 13 additions & 0 deletions
13
src/main/kotlin/info/mking/k2zpl/command/options/ZplCompressionType.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@file:Suppress("UNUSED") | ||
|
||
package info.mking.k2zpl.command.options | ||
|
||
enum class ZplCompressionType(private val value: Char) { | ||
ASCII('A'), | ||
BINARY('B'), | ||
COMPRESSED_BINARY('C'); | ||
|
||
override fun toString(): String { | ||
return value.toString() | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/test/kotlin/info/mking/k2zpl/command/GraphicFieldTest.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package info.mking.k2zpl.command | ||
|
||
import info.mking.k2zpl.command.options.ZplCompressionType | ||
import info.mking.k2zpl.k2zpl | ||
import io.kotest.core.spec.IsolationMode | ||
import io.kotest.core.spec.style.DescribeSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class GraphicFieldTest : DescribeSpec({ | ||
isolationMode = IsolationMode.InstancePerLeaf | ||
|
||
describe("GraphicField") { | ||
|
||
} | ||
describe("graphicField extension function") { | ||
it("outputs correct command") { | ||
val result = k2zpl { | ||
graphicField( | ||
format = ZplCompressionType.BINARY, | ||
dataBytes = 1024, | ||
totalBytes = 2048, | ||
rowBytes = 10000, | ||
data = "data" | ||
) | ||
} | ||
result shouldBe "^GFB,1024,2048,10000,data\n" | ||
} | ||
} | ||
}) |