Changeset 24304
- Timestamp:
- Jun 2, 2009, 4:29:49 PM (17 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 3 edited
-
Changes (modified) (1 diff)
-
lib/Nebulous/Key.pm (modified) (1 diff)
-
t/75_parse_neb_key.t (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r24291 r24304 2 2 3 3 0.17 4 - add params checking to Nebulous::Key::parse_neb_key() 4 5 - restrict creation/modification/remove of xattrs to the user.* namespace 5 6 - add chmod_object() method -
trunk/Nebulous-Server/lib/Nebulous/Key.pm
r23932 r24304 27 27 { 28 28 my ($key, $volume) = @_; 29 return unless defined $key; 29 30 die "key param is not optional" unless defined $key; 31 die "too many params" if scalar @_ > 2; 30 32 31 33 # white space is not allowed -
trunk/Nebulous-Server/t/75_parse_neb_key.t
r23932 r24304 10 10 use Test::More; 11 11 12 plan tests => 99;12 plan tests => 103; 13 13 14 14 use lib qw( ./t ./lib ); … … 322 322 }; 323 323 like( $@, qr/requires a path/, "no path" ); 324 325 # params 326 eval { 327 my $key = parse_neb_key(); 328 }; 329 like( $@, qr/key param is not optional/, "no params" ); 330 331 eval { 332 my $key = parse_neb_key(undef); 333 }; 334 like( $@, qr/key param is not optional/, "key is undef" ); 335 336 eval { 337 my $key = parse_neb_key(undef, 'bar'); 338 }; 339 like( $@, qr/key param is not optional/, "key is undef" ); 340 341 eval { 342 my $key = parse_neb_key('foo', 'bar', 'foo'); 343 }; 344 like( $@, qr/too many params/, "too many params" );
Note:
See TracChangeset
for help on using the changeset viewer.
