Renamed to remove from auto-running
[dbsrgits/DBM-Deep.git] / t / 10_largekeys.t
CommitLineData
ffed8b01 1##
2# DBM::Deep Test
3##
4use strict;
5use Test::More tests => 14;
6
7use_ok( 'DBM::Deep' );
8
9unlink "t/test.db";
10my $db = DBM::Deep->new(
11 file => "t/test.db"
12);
13if ($db->error()) {
14 die "ERROR: " . $db->error();
15}
16
17##
18# large keys
19##
20my $key1 = "Now is the time for all good men to come to the aid of their country." x 100;
21my $key2 = "The quick brown fox jumped over the lazy, sleeping dog." x 1000;
22my $key3 = "Lorem dolor ipsum latinum suckum causum Ium cannotum rememberum squatum." x 1000;
23
24$db->put($key1, "value1");
25$db->store($key2, "value2");
26$db->{$key3} = "value3";
27
28is( $db->{$key1}, 'value1', "Hash retrieval of put()" );
29is( $db->{$key2}, 'value2', "Hash retrieval of store()" );
30is( $db->{$key3}, 'value3', "Hash retrieval of hashstore" );
31is( $db->get($key1), 'value1', "get() retrieval of put()" );
32is( $db->get($key2), 'value2', "get() retrieval of store()" );
33is( $db->get($key3), 'value3', "get() retrieval of hashstore" );
34is( $db->fetch($key1), 'value1', "fetch() retrieval of put()" );
35is( $db->fetch($key2), 'value2', "fetch() retrieval of store()" );
36is( $db->fetch($key3), 'value3', "fetch() retrieval of hashstore" );
37
38my $test_key = $db->first_key();
39ok(
40 ($test_key eq $key1) ||
41 ($test_key eq $key2) ||
42 ($test_key eq $key3)
43);
44
45$test_key = $db->next_key($test_key);
46ok(
47 ($test_key eq $key1) ||
48 ($test_key eq $key2) ||
49 ($test_key eq $key3)
50);
51
52$test_key = $db->next_key($test_key);
53ok(
54 ($test_key eq $key1) ||
55 ($test_key eq $key2) ||
56 ($test_key eq $key3)
57);
58
59$test_key = $db->next_key($test_key);
60ok( !$test_key );