]> git.sur5r.net Git - i3/i3/blobdiff - testcases/t/116-nestedcons.t
Handle _NET_WM_STATE_STICKY, but only for floating containers. If this atom is set...
[i3/i3] / testcases / t / 116-nestedcons.t
index f6d4848dd8afd57bcf9464c68a68fbf9f694a163..5e3110adcad16ba649c8bfe3b284df91ff7ff809 100644 (file)
@@ -1,5 +1,18 @@
 #!perl
 # vim:ts=4:sw=4:expandtab
+#
+# Please read the following documents before working on tests:
+# • http://build.i3wm.org/docs/testsuite.html
+#   (or docs/testsuite)
+#
+# • http://build.i3wm.org/docs/lib-i3test.html
+#   (alternatively: perldoc ./testcases/lib/i3test.pm)
+#
+# • http://build.i3wm.org/docs/ipc.html
+#   (or docs/ipc)
+#
+# • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf
+#   (unless you are already familiar with Perl)
 
 use i3test;
 use List::Util qw(first);
@@ -34,23 +47,30 @@ my $ignore = \"";
 
 my $expected = {
     fullscreen_mode => 0,
+    sticky => $ignore,
     nodes => $ignore,
     window => undef,
     name => 'root',
     orientation => $ignore,
-    type => 0,
+    type => 'root',
     id => $ignore,
     rect => $ignore,
+    deco_rect => $ignore,
     window_rect => $ignore,
     geometry => $ignore,
     swallows => $ignore,
     percent => undef,
-    layout => 'default',
+    layout => 'splith',
+    floating => 'auto_off',
+    last_split_layout => 'splith',
+    scratchpad_state => 'none',
     focus => $ignore,
     focused => JSON::XS::false,
     urgent => JSON::XS::false,
     border => 'normal',
     'floating_nodes' => $ignore,
+    workspace_layout => 'default',
+    current_border_width => -1,
 };
 
 # a shallow copy is sufficient, since we only ignore values at the root
@@ -72,16 +92,16 @@ my @nodes = @{$tree->{nodes}};
 
 ok(@nodes > 0, 'root node has at least one leaf');
 
-ok((all { $_->{type} == 1 } @nodes), 'all nodes are of type CT_OUTPUT');
+ok((all { $_->{type} eq 'output' } @nodes), 'all nodes are of type CT_OUTPUT');
 ok((none { defined($_->{window}) } @nodes), 'no CT_OUTPUT contains a window');
 ok((all { @{$_->{nodes}} > 0 } @nodes), 'all nodes have at least one leaf (workspace)');
 my @workspaces;
 for my $ws (@nodes) {
-    my $content = first { $_->{type} == 2 } @{$ws->{nodes}};
+    my $content = first { $_->{type} eq 'con' } @{$ws->{nodes}};
     @workspaces = (@workspaces, @{$content->{nodes}});
 }
 
-ok((all { $_->{type} == 4 } @workspaces), 'all workspaces are of type CT_WORKSPACE');
+ok((all { $_->{type} eq 'workspace' } @workspaces), 'all workspaces are of type CT_WORKSPACE');
 #ok((all { @{$_->{nodes}} == 0 } @workspaces), 'all workspaces are empty yet');
 ok((none { defined($_->{window}) } @workspaces), 'no CT_OUTPUT contains a window');