xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
<root> / tests / misc / viewport_moving.c (853cc7fa8fce44f359e76c04b2f917a68e258473) (1,721B) (mode 100644) [raw]
#include <stic.h>

#include <test-utils.h>

#include "../../src/engine/keys.h"
#include "../../src/modes/modes.h"
#include "../../src/modes/wk.h"
#include "../../src/ui/ui.h"
#include "../../src/status.h"

SETUP()
{
	curr_view = &lwin;

	modes_init();
	opt_handlers_setup();
}

TEARDOWN()
{
	opt_handlers_teardown();
	vle_keys_reset();
}

TEST(view_is_split_vertically_if_only_mode_was_active)
{
	curr_view = &rwin;
	other_view = &lwin;
	curr_stats.number_of_windows = 1;
	(void)vle_keys_exec_timed_out(WK_C_w WK_H);
	assert_int_equal(2, curr_stats.number_of_windows);
	assert_int_equal(VSPLIT, curr_stats.split);
}

TEST(view_is_split_horizontally_if_only_mode_was_active)
{
	curr_view = &rwin;
	other_view = &lwin;
	curr_stats.number_of_windows = 1;
	(void)vle_keys_exec_timed_out(WK_C_w WK_J);
	assert_int_equal(2, curr_stats.number_of_windows);
	assert_int_equal(HSPLIT, curr_stats.split);
}

TEST(ctrl_w_H)
{
	curr_view = &rwin;
	other_view = &lwin;
	(void)vle_keys_exec_timed_out(WK_C_w WK_H);
	assert_true(curr_view == &lwin);
	assert_true(other_view == &rwin);
}

TEST(ctrl_w_L)
{
	curr_view = &lwin;
	other_view = &rwin;
	(void)vle_keys_exec_timed_out(WK_C_w WK_L);
	assert_true(curr_view == &rwin);
	assert_true(other_view == &lwin);
}

TEST(ctrl_w_J)
{
	curr_view = &lwin;
	other_view = &rwin;
	(void)vle_keys_exec_timed_out(WK_C_w WK_J);
	assert_true(curr_view == &rwin);
	assert_true(other_view == &lwin);
}

TEST(ctrl_w_K)
{
	curr_view = &rwin;
	other_view = &lwin;
	(void)vle_keys_exec_timed_out(WK_C_w WK_K);
	assert_true(curr_view == &lwin);
	assert_true(other_view == &rwin);
}

/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
/* vim: set cinoptions+=t0 filetype=c : */
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master