diff options
author | Tom Feist <shabble@metavore.org> | 2011-02-28 20:53:15 +0000 |
---|---|---|
committer | Tom Feist <shabble@metavore.org> | 2011-02-28 20:53:15 +0000 |
commit | fa7b4c4482f718ffbcbfe580c37f9c2f2067ec43 (patch) | |
tree | 3bc26cd3b873cd91d77067835206db27d4651e6a /testing/test3.pl | |
parent | refactor everything to make tests more test-like. (diff) | |
download | irssi-scripts-fa7b4c4482f718ffbcbfe580c37f9c2f2067ec43.tar.gz irssi-scripts-fa7b4c4482f718ffbcbfe580c37f9c2f2067ec43.zip |
added other tests
Diffstat (limited to '')
-rwxr-xr-x | testing/test3.pl | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/testing/test3.pl b/testing/test3.pl new file mode 100755 index 0000000..1c783ac --- /dev/null +++ b/testing/test3.pl @@ -0,0 +1,42 @@ +#!/usr/bin/env perl + +use strict; +use warnings; + +use feature qw/say/; + +use lib 'blib/lib'; + +use Test::Irssi; + +my $tester = Test::Irssi->new + (irssi_binary => "/opt/stow/repo/irssi-debug/bin/irssi", + irssi_homedir => $ENV{HOME} . "/projects/tmp/test/irssi-debug"); + +say "Created test instance"; + +my $test = $tester->new_test('test1'); + +$test->add_input_sequence("/echo Hello cats\n"); +$test->add_delay(1); +$test->add_input_sequence("/echo Hello Again\n"); +$test->add_input_sequence("this is a long test"); +$test->add_pattern_match(qw/long/, 'prompt', 'prompt contains hello'); + +my $test2 = $tester->new_test('test2'); +$test2->add_delay(1); +$test2->add_input_sequence("\x01"); +$test2->add_delay(0.1); +$test2->add_input_sequence("\x0b"); +$test2->add_delay(0.1); +$test2->add_input_sequence("/clear\n"); +$test2->add_delay(0.1); +$test2->add_input_sequence("/echo moo\n"); + +# for (1..10) { +# $test->add_input_sequence("\xff"); +# $test->add_delay(0.1); + +# } + +$tester->run; |