]> git.sur5r.net Git - i3/i3/blob - testcases/t/193-ipc-version.t
ipc: implement GET_VERSION to find out the i3 version
[i3/i3] / testcases / t / 193-ipc-version.t
1 #!perl
2 # vim:ts=4:sw=4:expandtab
3 # Verifies that we can get the version number of i3 via IPC.
4 use i3test;
5
6 my $i3 = i3(get_socket_path());
7 $i3->connect->recv;
8 # We explicitly send the version message because AnyEvent::I3’s 'version' sugar
9 # method has a fallback which tries to parse the version number from i3
10 # --version for older versions, and we want to avoid using that.
11 my $version = $i3->message(7, "")->recv;
12
13 # We need to change this when the major version changes (but we need to touch a
14 # lot of changes then anyways).
15 is($version->{major}, 4, 'major version is 4');
16
17 cmp_ok($version->{minor}, '>', 0, 'minor version > 0');
18
19 is(int($version->{minor}), $version->{minor}, 'minor version is an integer');
20 is(int($version->{patch}), $version->{patch}, 'patch version is an integer');
21 like($version->{human_readable}, qr/branch/, 'human readable version contains branch name');
22
23 done_testing;