# Copyright (c) 2003 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: CSV.bunit,v 1.2 2010/08/23 21:16:56 moeller Exp $ use Bivio::UI::Widget::Join; Widget(); model('ProductList', { parent_id => 'DOGS', }); [ ['ProductList', ['Product.name', 'Product.product_id']] => qr/Product Name,Product ID\nCorgi,K9-BD-01\nDalmation.*Poodle/s, ['ProductList', [ ['Product.name', {column_heading => 'Name'}], ['Product.product_id', {column_heading => 'Id'}], ]] => qr/Name,Id\nCorgi,K9-BD-01\nDalmation.*Poodle/s, ['ProductList', [ ['Product.name', { column_heading => Bivio::UI::Widget::Join->new(['Name']), }], ['Product.product_id', { column_widget => Bivio::UI::Widget::Join->new(['ID: ', ['Product.product_id']]), }], ]] => qr/Name,Product ID\nCorgi,ID: K9-BD-01\nDalmation.*Poodle/s, ['ProductList', [ # Specify compatible type instead of Line ['Product.name', {type => Bivio::Type->get_instance('Name')}], 'Product.product_id', ]] => qr/Product Name,Product ID\nCorgi,K9-BD-01\nDalmation.*Poodle/s, ['ProductList', [ ['Product.name', { column_heading => 'Product', type => Bivio::Type->get_instance('Name'), }], 'Product.product_id', ]] => qr/Product,Product ID\nCorgi,K9-BD-01\nDalmation.*Poodle/s, ['ProductList', [ ['Product.name', { column_control => [sub {return 0}], }], ['Product.product_id', { column_control => [sub {return 1}], }], ]] => qr/Product ID\nK9-BD-01\n/s, ['ProductList', [ # Test invalid type ['Product.name', {type => Bivio::Type->get_instance('TimeZone')}], ]] => DIE(), ['Product', ['name'], {want_iterate_start => 1}] => qr/Corgi\nDalmation\nPoodle/s, ];