2 # vim:ts=4:sw=4:expandtab
4 # Please read the following documents before working on tests:
5 # • http://build.i3wm.org/docs/testsuite.html
8 # • http://build.i3wm.org/docs/lib-i3test.html
9 # (alternatively: perldoc ./testcases/lib/i3test.pm)
11 # • http://build.i3wm.org/docs/ipc.html
14 # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
15 # (unless you are already familiar with Perl)
17 # Verifies that we can get the version number of i3 via IPC.
20 my $i3 = i3(get_socket_path());
22 # We explicitly send the version message because AnyEvent::I3’s 'version' sugar
23 # method has a fallback which tries to parse the version number from i3
24 # --version for older versions, and we want to avoid using that.
25 my $version = $i3->message(7, "")->recv;
27 # We need to change this when the major version changes (but we need to touch a
28 # lot of changes then anyways).
29 is($version->{major}, 4, 'major version is 4');
31 cmp_ok($version->{minor}, '>', 0, 'minor version > 0');
33 is(int($version->{minor}), $version->{minor}, 'minor version is an integer');
34 is(int($version->{patch}), $version->{patch}, 'patch version is an integer');
35 like($version->{human_readable}, qr/branch/, 'human readable version contains branch name');