File: barcode.t

package info (click to toggle)
libbarcode-code128-perl 2.21-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 116 kB
  • sloc: perl: 374; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 493 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- Perl -*-

# Load the module
use Test::More tests => 3;
use strict;

BEGIN {
    $| = 1;
    use_ok('Barcode::Code128', qw(FNC1));
}

# Create a test barcode and make sure it is correct

ok(my $code = Barcode::Code128->new, 'constructor');

my $encoded = $code->barcode("1234 abcd");
cmp_ok($encoded, 'eq',
    "## #  ###  # ##  ###  #   # ##   # #### ### ## ##  ##  #  # ##    #".
    "  #    ## #    # ##  #    #  ## ###   # ## ##   ### # ##",
    "'1234 abcd' rendered as expected"
);