diff options
Diffstat (limited to 'feature-tests')
-rw-r--r-- | feature-tests/easy_exec.pl | 35 | ||||
-rw-r--r-- | feature-tests/template.pl | 8 |
2 files changed, 41 insertions, 2 deletions
diff --git a/feature-tests/easy_exec.pl b/feature-tests/easy_exec.pl new file mode 100644 index 0000000..dbcd101 --- /dev/null +++ b/feature-tests/easy_exec.pl @@ -0,0 +1,35 @@ +use strict; +use warnings; + +# export everything. +use Irssi (@Irssi::EXPORT_OK); +use Irssi::Irc; +use Irssi::TextUI; + +use Data::Dumper; + +our $VERSION = '0.1'; +our %IRSSI = ( + authors => 'shabble', + contact => 'shabble+irssi@metavore.org', + name => 'easy_exec', + description => 'drop-in replacement for /script exec which imports' + . ' all of the Irssi:: namespace for easier testing', + license => 'Public Domain', + ); + +Irssi::signal_add_first 'command script exec', \&better_exec; + +sub better_exec { + my ($args, $serv, $witem) = @_; + eval $args; + Irssi::signal_stop(); +} + +sub Dump { + print Dumper(\@_); +} + +sub test() { + print "This is a test"; +} diff --git a/feature-tests/template.pl b/feature-tests/template.pl index 2c75044..f3ae68a 100644 --- a/feature-tests/template.pl +++ b/feature-tests/template.pl @@ -3,12 +3,16 @@ use warnings; use Irssi; +use Irssi::Irc; +use Irssi::TextUI; + +use Data::Dumper; our $VERSION = '0.1'; our %IRSSI = ( - authors => '', - contact => '', + authors => 'shabble', + contact => 'shabble+irssi@metavore.org', name => '', description => '', license => 'Public Domain', |