File: single.t

package info (click to toggle)
libcrypt-simple-perl 0.06-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 84 kB
  • sloc: perl: 224; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w
use strict;
use Test;

plan tests => 5;

use Crypt::Simple;

my $plaintext = "A message before encryption or after decryption";
my $ciphertext = encrypt($plaintext);
my $nonsense = "Hello World!";

ok($ciphertext);
ok($ciphertext ne encrypt($nonsense));
ok($ciphertext eq encrypt($plaintext));
ok($plaintext eq decrypt($ciphertext));
eval { decrypt('VGhpcyBpcyBhIHRlc3Q=') };
ok($@);