-
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.
- Loading branch information
1 parent
ffc32b1
commit 202635d
Showing
3 changed files
with
35 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
package info.mking.k2zpl.command | ||
|
||
import info.mking.k2zpl.builder.ZplBuilder | ||
import info.mking.k2zpl.builder.command | ||
|
||
internal data object EndFormat : ZplCommand { | ||
override val command: CharSequence = "^XZ" | ||
} | ||
|
||
/** | ||
* Ends the label format. | ||
*/ | ||
fun ZplBuilder.endFormat() { | ||
command(EndFormat) | ||
} |
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,25 @@ | ||
package info.mking.k2zpl.command | ||
|
||
import info.mking.k2zpl.k2zpl | ||
import info.mking.k2zpl.testBuildString | ||
import io.kotest.core.spec.IsolationMode | ||
import io.kotest.core.spec.style.DescribeSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class EndFormatTest : DescribeSpec({ | ||
isolationMode = IsolationMode.InstancePerLeaf | ||
|
||
describe("EndFormat") { | ||
it("outputs correct command") { | ||
EndFormat.testBuildString() shouldBe "^XZ" | ||
} | ||
} | ||
describe("endFormat extension fucntion") { | ||
it("outputs correct command") { | ||
val result = k2zpl { | ||
endFormat() | ||
} | ||
result shouldBe "^XZ\n" | ||
} | ||
} | ||
}) |