File: new-line.t

package info (click to toggle)
libcgi-session-expiresessions-perl 1.14-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: perl: 274; makefile: 8
file content (32 lines) | stat: -rw-r--r-- 891 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
#!/usr/bin/env perl

use strict;
use diagnostics;

BEGIN
{
	use Test::More;
	plan(tests => 5);
	use_ok('CGI::Session');
	use_ok('CGI::Session::ExpireSessions');
};

# Create a block so $s goes out of scope before we try to access the session.
# Without the {}, CGI::Session::ExpireSessions does not see this session,
# although it will see sessions created by previous runs of this program.

{
	my($s) = new CGI::Session(undef, undef, {Directory => 't'} );

	ok($s, 'The test session has been created');

	$s -> expire(1);

	ok($s -> id, "The test session's id has been set");

	$s -> param(purpose => "Test new-line within session data. Works with CGI::Session::ExpireSessions V 1.06\n");

	ok($s -> param('purpose'), "The test session's parameter called 'purpose' has been set");
}

CGI::Session::ExpireSessions -> new(delta => 0, temp_dir => 't', verbose => 1) -> expire_file_sessions();