"Fossies" - the Fresh Open Source Software Archive

Member "eprints3.4-3.4.4/tests/67_crypt.pl" (7 Aug 2022, 1308 Bytes) of package /linux/www/eprints3.4-3.4.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "67_crypt.pl": 3.4-3.4.3_vs_3.4-3.4.4.

    1 use Test::More tests => 5;
    2 
    3 BEGIN { use_ok( "EPrints" ); }
    4 BEGIN { use_ok( "EPrints::Test" ); }
    5 
    6 my $session = EPrints::Test::get_test_session();
    7 
    8 my $password = "bears love picnics";
    9 
   10 my $crypt = EPrints::Utils::crypt_password( $password, $session );
   11 ok($crypt =~ /^\?/, "crypt is typed");
   12 my $uri = URI->new( $crypt );
   13 ok(length({$uri->query_form}->{digest}), "digest is non-blank");
   14 
   15 ok(EPrints::Utils::crypt_equals( $crypt, $password ), "password matches");
   16 
   17 =head1 COPYRIGHT
   18 
   19 =for COPYRIGHT BEGIN
   20 
   21 Copyright 2022 University of Southampton.
   22 EPrints 3.4 is supplied by EPrints Services.
   23 
   24 http://www.eprints.org/eprints-3.4/
   25 
   26 =for COPYRIGHT END
   27 
   28 =for LICENSE BEGIN
   29 
   30 This file is part of EPrints 3.4 L<http://www.eprints.org/>.
   31 
   32 EPrints 3.4 and this file are released under the terms of the
   33 GNU Lesser General Public License version 3 as published by
   34 the Free Software Foundation unless otherwise stated.
   35 
   36 EPrints 3.4 is distributed in the hope that it will be useful,
   37 but WITHOUT ANY WARRANTY; without even the implied warranty of
   38 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
   39 See the GNU Lesser General Public License for more details.
   40 
   41 You should have received a copy of the GNU Lesser General Public
   42 License along with EPrints 3.4.
   43 If not, see L<http://www.gnu.org/licenses/>.
   44 
   45 =for LICENSE END
   46