diff options
author | Tom Feist <shabble@metavore.org> | 2011-04-22 02:27:12 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2011-04-22 02:27:12 +0000 |
commit | fe6e50a76dba36899782fdda0f97590ee5f02a3c (patch) | |
tree | a8ae7406048f00807ba54aecb5dfcd9c0dd08944 /feature-tests/format-test.pl | |
parent | removed docs/ from dev branch, since they're all in their own repo (well, wiki) (diff) | |
parent | feature-tests/key_sig: test to see if there's any useful info in the 'keyboard (diff) | |
download | irssi-scripts-fe6e50a76dba36899782fdda0f97590ee5f02a3c.tar.gz irssi-scripts-fe6e50a76dba36899782fdda0f97590ee5f02a3c.zip |
Merge branch 'master' into dev
Diffstat (limited to '')
-rw-r--r-- | feature-tests/format-test.pl | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/feature-tests/format-test.pl b/feature-tests/format-test.pl index d8be412..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 = ( @@ -14,13 +14,26 @@ our %IRSSI = ( license => 'Public Domain', ); +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 { - Irssi::command_bind('ft', \&format_test); -} + my $win = Irssi::active_win(); + my $moo = actually_printformat($win, Irssi::MSGLEVEL_CLIENTCRAP, 'fe-common/irc', + "kill_server", "foo", "bar", "horse", "cake"); + print Dumper($moo); -sub format_test { - my ($args, $win, $server) = @_; } |