1#!/usr/bin/perl -w 2 3# Test the $arg! required syntax 4 5use strict; 6use warnings; 7 8use Test::More; 9 10 11{ 12 package Stuff; 13 14 use lib 't/lib'; 15 use GenErrorRegex qw< required_error >; 16 17 use Test::More; 18 use Test::Exception; 19 use Method::Signatures; 20 21 method whatever($this!) { 22 return $this; 23 } 24 25 is( Stuff->whatever(23), 23 ); 26 27#line 23 28 throws_ok { Stuff->whatever() } required_error('Stuff', '$this', 'whatever', LINE => 23), 29 'simple required param error okay'; 30 31 method some_optional($that!, $this = 22) { 32 return $that + $this 33 } 34 35 is( Stuff->some_optional(18), 18 + 22 ); 36 37#line 33 38 throws_ok { Stuff->some_optional() } required_error('Stuff', '$that', 'some_optional', LINE => 33), 39 'some required/some not required param error okay'; 40} 41 42 43done_testing(); 44