aboutsummaryrefslogtreecommitdiffstats
path: root/testing/test3.pl
blob: 57be5ed5b20f756d150b8f1f938aa0a98be71939 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/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 lang test");
$test->add_pattern_match(qw/long/, 'prompt', 'prompt contains hello');
$test->add_pattern_match(qw/longfdajkfd/, 'prompt', 'prompt contains hello');


my $test2 = $tester->new_test('test2');
$test2->add_delay(2);
$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");

my $quit = $tester->new_test('quit');
$quit->add_input_sequence("/quit\n");

# for (1..10) {
#     $test->add_input_sequence("\xff");
#     $test->add_delay(0.1);
    
# }

$tester->run;