Protocol-Zebra-Label/t/label.t
2013-04-10 12:21:51 +02:00

27 lines
1.1 KiB
Perl

use Test::More;
use Test::LongString;
use Protocol::Zebra::Label;
my $p = Protocol::Zebra::Label->new;
ok($p);
is_string($p->header, "^XA~TA000~JSN~LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD25~JO^JUS^LRY^CI0^XZ^XA^MMT^PW254^LL0203^LS0");
is_string($p->format({ name => "Test product", barcode => "812345678901", price => "EUR 1,00", count => 1 }),
"^XA~TA000~JSN~LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD25~JO^JUS^LRY^CI0^XZ^XA^MMT^PW254^LL0203^LS0"
."^FT16,32^A0N,20,20^FH\\^FDTest product^FS"
."^FT16,70^A0N,32,32^FH\\^FDEUR 1,00^FS"
."^BY2,2,56^FT32,158^BEN,,Y,N\r\n^FD812345678901^FS"
."^PQ1,0,1,Y^XZ\r\n");
is_string($p->format({ name => "Test product met een langere naam", barcode => "812345678901", price => "EUR 1,00", count => 1 }),
"^XA~TA000~JSN~LT0^MNW^MTD^PON^PMN^LH0,0^JMA^PR2,2~SD25~JO^JUS^LRY^CI0^XZ^XA^MMT^PW254^LL0203^LS0"
."^FT16,32^A0N,20,20^FH\\^FDTest product met een^FS"
."^FT16,54^A0N,20,20^FH\\^FDlangere naam^FS"
."^FT16,92^A0N,32,32^FH\\^FDEUR 1,00^FS"
."^BY2,2,56^FT32,158^BEN,,Y,N\r\n^FD812345678901^FS"
."^PQ1,0,1,Y^XZ\r\n");
done_testing();