File: both_long.t

package info (click to toggle)
ciphersaber 1.01-2.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: perl: 313; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!perl -w

# encrypt and decrypt a line greater than 256 characters long
# this tests for a subtle bug, ie, missing a modulo on $i

BEGIN
{
	chdir 't' if -d 't';
}

use strict;

use Test::More tests => 2;

use_ok('Crypt::CipherSaber');

my $cs        = Crypt::CipherSaber->new( 'first key' );
my $long_line = join( ' ', ( 1 .. 100 ) );
my $coded     = $cs->encrypt($long_line);
is( $cs->decrypt( $coded ), $long_line, 'round-tripping should work' );