diff options
author | Tom Feist <shabble@metavore.org> | 2011-01-12 00:10:16 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2011-01-12 00:10:16 +0000 |
commit | d285e7854dfc62c213bec4c101eaf080fa81ac46 (patch) | |
tree | 6bd9a64ea281dcc40259aa391fc41f2e9ea91258 /feature-tests/format-test.pl | |
parent | some dirty hacks to make the package appear as an internal module, LeoNerd++ (diff) | |
download | irssi-scripts-d285e7854dfc62c213bec4c101eaf080fa81ac46.tar.gz irssi-scripts-d285e7854dfc62c213bec4c101eaf080fa81ac46.zip |
pipes: added an example feature test on how to use pipes for non-blocking
IO. Hope to expand it to include network IO at some point.
Diffstat (limited to '')
-rw-r--r-- | feature-tests/format-test.pl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/feature-tests/format-test.pl b/feature-tests/format-test.pl index 2c99d50..7a38d9f 100644 --- a/feature-tests/format-test.pl +++ b/feature-tests/format-test.pl @@ -3,7 +3,7 @@ use warnings; use Irssi; - +use Data::Dumper; our $VERSION = '0.1'; our %IRSSI = ( @@ -16,19 +16,24 @@ our %IRSSI = ( sub actually_printformat { my ($win, $level, $module, $format, @args) = @_; + my $ret = ''; { # deeeeeeep black magic. local *CORE::GLOBAL::caller = sub { $module }; $win->printformat($level, $format, @args); - } + $ret = Irssi::current_theme()->get_format($module, $format); + } + return $ret; } init(); sub init { my $win = Irssi::active_win(); - actually_printformat($win, Irssi::MSGLEVEL_CLIENTCRAP, 'fe-common/irc', - "kill_server", "foo", "bar", "horse", "cake"); + my $moo = actually_printformat($win, Irssi::MSGLEVEL_CLIENTCRAP, 'fe-common/irc', + "kill_server", "foo", "bar", "horse", "cake"); + + print Dumper($moo); } |