# Copyright (c) 2009 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: CallingContext.bunit,v 1.1 2009/10/10 04:09:54 nagler Exp $ my($new) = sub {class()->new_from_file_line(@_)}; my($here) = sub {class()->new_from_caller}; [ sub {$new->('f', 3)} => [ as_string => 'CallingContext(f,3)', equals => [ [$new->('f', 3)] => 1, [undef] => 0, [$new->('f', 2)] => 0, [$new->('x', 3)] => 0, ], inc_line => [ -1 => [$new->('f', 2)], 1 => [$new->('f', 4)], ], ], sub {$here->()} => [ as_string => qr{^CallingContext\(\(eval \d+\),\d+\)$}, ], ];