+
+# param()
+{
+ my $p = { foo => 'bar',
+ quux => [ qw/one two three/ ],
+ buz => undef,
+ num => 3,
+ zero => 0,
+ };
+
+ $r->{params} = $p;
+
+ is_deeply( [keys %$p], [$r->param] );
+
+ cmp_ok( $r->param('foo'), eq => 'bar' );
+ cmp_ok( $r->param('num'), '==' => 3 );
+ cmp_ok( $r->param('zero'), '==' => 0 );
+
+ ok( ! defined $r->param('buz') );
+
+ # scalar context returns the 1st value, not a ref
+ cmp_ok( scalar $r->param('quux'), eq => 'one' );
+ is_deeply( [$r->param('quux')], [ qw/one two three/ ] );
+
+ $r->param(foo => 'booze');
+ cmp_ok( $r->param('foo'), 'eq', 'booze' );
+
+ $r->param(foo => undef);
+ ok( ! defined $r->param('foo') );
+
+ # cannot introduce new keys
+ $r->param(new => 'sox');
+ ok( ! defined $r->param('new') );
+}
+