# Copyright (c) 2007-2010 bivio Software, Inc. All Rights Reserved. # # Visit http://www.bivio.biz for more info. # # This library is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; If not, you may get a copy from: # http://www.opensource.org/licenses/lgpl-license.html # # $Id: FileField.bunit,v 1.4 2010/10/17 22:16:06 nagler Exp $ Type(); [ from_disk => [ 'FileField/t1.txt' => [{ filename => 't1.txt', content => \("line1\n"), content_type => 'text/plain', }], ], unsafe_from_disk => [ '' => UNDEF(), 'not-found' => [undef, Bivio::TypeError->NOT_FOUND], [{ filename => 'a', content => \("b"), content_type => 'c', }] => sub {shift->get('params')}, ], from_string_ref => [ [\('x')] => [{ content => \('x'), filename => '', content_type => 'application/octet-stream', }], ], from_any => [ [{ content => \('y'), filename => 'y', content_type => 'text/plain', }] => [{ content => \('y'), filename => 'y', content_type => 'text/plain', }], [\('x')] => [{ content => \('x'), filename => '', content_type => 'application/octet-stream', }], 'FileField/t1.txt' => [{ filename => 't1.txt', content => \("line1\n"), content_type => 'text/plain', }], "a\nb" => [{ filename => '', content => \("a\nb"), content_type => 'application/octet-stream', }], 'not-found' => DIE(), ], ];