Files
tmuxifier/test/lib/layout-helpers/__get_first_window_index.test.sh

30 lines
753 B
Bash
Executable File

#! /usr/bin/env bash
source "../../test-helper.sh"
source "${root}/lib/layout-helpers.sh"
#
# __get_first_window_index() tests.
#
# When first window has a index of 0.
create-test-session "test"
assert "__get_first_window_index" "0"
kill-test-session "test"
# When first window has a index of 1.
create-test-session "test"
test-socket-tmux new-window -t "$session:1"
test-socket-tmux kill-window -t "$session:0"
assert "__get_first_window_index" "1"
kill-test-session "test"
# When first window has a index of 2.
create-test-session "test"
test-socket-tmux new-window -t "$session:2"
test-socket-tmux kill-window -t "$session:0"
assert "__get_first_window_index" "2"
kill-test-session "test"
# End of tests.
assert_end "__get_first_window_index()"