aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-01-01 18:03:30 +0000
committerTom Feist <shabble@metavore.org>2011-01-01 18:03:30 +0000
commit6b02695d66cfe4c6a0c94d6291585556cac5a2c3 (patch)
tree408823bc031cb6b7d3c9e9450a4bc2a3144de1a5 /feature-tests
parentdocs/General/Internals: start of some documentation of the internals of how (diff)
downloadirssi-scripts-6b02695d66cfe4c6a0c94d6291585556cac5a2c3.tar.gz
irssi-scripts-6b02695d66cfe4c6a0c94d6291585556cac5a2c3.zip
feature-tests: looking at ways to read from a DATA fh, and redirect normal
command output so it can be parsed.
Diffstat (limited to 'feature-tests')
-rw-r--r--feature-tests/data.pl32
-rw-r--r--feature-tests/redir-input.pl30
2 files changed, 62 insertions, 0 deletions
diff --git a/feature-tests/data.pl b/feature-tests/data.pl
new file mode 100644
index 0000000..464a148
--- /dev/null
+++ b/feature-tests/data.pl
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+
+use Irssi;
+use Irssi::Irc;
+use Irssi::TextUI;
+
+use Data::Dumper;
+
+
+our $VERSION = '0.1';
+our %IRSSI = (
+ authors => 'shabble',
+ contact => 'shabble+irssi@metavore.org',
+ name => '',
+ description => '',
+ license => 'Public Domain',
+ );
+
+
+for my $line (<DATA>) {
+ chomp $line;
+ Irssi::active_win()->print($line);
+}
+
+__DATA__
+this is a test
+so is this.
+%rcolour?%n
+what
+yes
diff --git a/feature-tests/redir-input.pl b/feature-tests/redir-input.pl
new file mode 100644
index 0000000..94ca523
--- /dev/null
+++ b/feature-tests/redir-input.pl
@@ -0,0 +1,30 @@
+use strict;
+use warnings;
+
+
+use Irssi;
+use Irssi::Irc;
+use Irssi::TextUI;
+
+use Data::Dumper;
+
+
+our $VERSION = '0.1';
+our %IRSSI = (
+ authors => 'shabble',
+ contact => 'shabble+irssi@metavore.org',
+ name => '',
+ description => '',
+ license => 'Public Domain',
+ );
+
+
+Irssi::command_bind("ri", \&cmd_ri);
+
+sub cmd_ri {
+ my ($args, $server, $witem) = @_;
+ my $win = Irssi::active_win();
+
+ #my $ref = Irssi::windows_refnum_last
+ $win->format_create_dest(Irssi::MSGLEVEL_ClIENTCRAP());
+}