]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Dec 2011 14:22:57 +0000 (14:22 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 17 Dec 2011 14:22:57 +0000 (14:22 +0000)
Conflicts:
testcases/t/173-get-marks.t

1  2 
testcases/t/111-goto.t
testcases/t/173-get-marks.t

diff --combined testcases/t/111-goto.t
index dd60d9cf200d33964b8471cd306d2e43be3410ae,5cc20481d02a68b8ed9735c3d97a23e05a7fe6a8..078ab92c071ff8b6a55b25320262f7383997a936
@@@ -4,6 -4,8 +4,6 @@@
  use i3test;
  use File::Temp;
  
 -my $x = X11::XCB::Connection->new;
 -
  my $tmp = fresh_workspace;
  
  cmd 'split h';
@@@ -12,9 -14,9 +12,9 @@@
  # Create two windows and make sure focus switching works
  #####################################################################
  
 -my $top = open_window($x);
 -my $mid = open_window($x);
 -my $bottom = open_window($x);
 +my $top = open_window;
 +my $mid = open_window;
 +my $bottom = open_window;
  
  #
  # Returns the input focus after sending the given command to i3 via IPC
@@@ -24,10 -26,11 +24,10 @@@ sub focus_after 
      my $msg = shift;
  
      cmd $msg;
 -    sync_with_i3($x);
      return $x->input_focus;
  }
  
 -$focus = $x->input_focus;
 +my $focus = $x->input_focus;
  is($focus, $bottom->id, "Latest window focused");
  
  $focus = focus_after('focus left');
@@@ -58,6 -61,24 +58,24 @@@ is($focus, $top->id, "Top window focuse
  $focus = focus_after(qq|[con_mark="$random_mark" con_mark="$random_mark"] focus|);
  is($focus, $mid->id, "goto worked");
  
+ #####################################################################
+ # Set the same mark multiple times and see if focus works correctly
+ #####################################################################
+ $focus = focus_after('focus left');
+ is($focus, $top->id, "Top window focused");
+ cmd "mark $random_mark";
+ $focus = focus_after(qq|[con_mark="$random_mark"] focus|);
+ is($focus, $top->id, "focus unchanged after goto");
+ $focus = focus_after('focus right');
+ is($focus, $mid->id, "mid window focused");
+ $focus = focus_after(qq|[con_mark="$random_mark"] focus|);
+ is($focus, $top->id, "goto worked");
  #####################################################################
  # Check whether the focus command will switch to a different
  # workspace if necessary
index 75b6e7a8f0594c34e593cdbb73be277f4053b8c7,007d5a6d507ee1645873900eed41434a97b8fb90..e8964d307b7a8d3a7e57d208558e885d2caebf26
@@@ -16,7 -16,7 +16,7 @@@ sub get_marks 
  my $tmp = fresh_workspace;
  
  my $marks = get_marks();
 -cmp_deeply($marks, [], 'no marks set so far');
 +is_deeply($marks, [], 'no marks set so far');
  
  ##############################################################
  # 2: check that setting a mark is reflected in the get_marks reply
@@@ -25,7 -25,7 +25,7 @@@
  cmd 'open';
  cmd 'mark foo';
  
 -cmp_deeply(get_marks(), [ 'foo' ], 'mark foo set');
 +is_deeply(get_marks(), [ 'foo' ], 'mark foo set');
  
  ##############################################################
  # 3: check that the mark is gone after killing the container
  
  cmd 'kill';
  
 -cmp_deeply(get_marks(), [ ], 'mark gone');
 +is_deeply(get_marks(), [ ], 'mark gone');
  
- ##############################################################
- # 4: check that duplicate marks are included twice in the get_marks reply
- ##############################################################
- cmd 'open';
- cmd 'mark bar';
- cmd 'open';
- cmd 'mark bar';
- is_deeply(get_marks(), [ 'bar', 'bar' ], 'duplicate mark found twice');
  done_testing;