File: 01-plot.t

package info (click to toggle)
libtext-qrcode-perl 0.05-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 312 kB
  • sloc: perl: 2,228; makefile: 3
file content (42 lines) | stat: -rwxr-xr-x 837 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!perl -T

use Test::More tests => 2;

BEGIN {
	use_ok( 'Text::QRCode' );
}

sub match_test {
    my $arrayref = Text::QRCode->new->plot( $_[0]->[0] );
    my $got = join( "\n", map { join '', @$_ } @$arrayref ) . "\n";
    my $expect = $_[0]->[1];
    is( $got, $expect, 'match test');
}

my @Tests = (
    [ 'Some text here.', <<'TEXT' ],
******* *  ** *******
*     *   * * *     *
* *** *       * *** *
* *** *   **  * *** *
* *** *  * *  * *** *
*     *  **** *     *
******* * * * *******
        *  **        
** ** *   *** *     *
*   **  ***    * *   
 * ****     * *    **
*    * * * * * ** ***
  **  *   ***   ** **
        * **  * **  *
*******  *****  ***  
*     *  * ** * **** 
* *** * *   *    * * 
* *** * * **   *  *  
* *** *     *** * ***
*     * **  * *   ***
******* * *  ****    
TEXT
);

match_test( $Tests[0] );