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 / menus / registers.c (76377d55f7a8d4e9fb75d70f0a633734cb655804) (1,141B) (mode 100644) [raw]
#include <stic.h>

#include "../../src/engine/keys.h"
#include "../../src/menus/registers_menu.h"
#include "../../src/modes/menu.h"
#include "../../src/modes/modes.h"
#include "../../src/modes/wk.h"
#include "../../src/ui/statusbar.h"
#include "../../src/ui/ui.h"
#include "../../src/registers.h"
#include "../../src/status.h"

SETUP()
{
	regs_init();
	modes_init();

	curr_stats.load_stage = -1;
}

TEARDOWN()
{
	(void)vle_keys_exec(WK_ESC);

	vle_keys_reset();
	regs_reset();

	curr_stats.load_stage = 0;
}

TEST(empty_registers_menu_is_not_displayed)
{
	ui_sb_msg("");
	assert_failure(show_register_menu(&lwin, "a"));
	assert_string_equal("Registers are empty", ui_sb_last());
}

TEST(registers_menu)
{
	regs_append('a', "1");
	regs_append('a', "2");

	assert_success(show_register_menu(&lwin, "a"));

	assert_int_equal(3, menu_get_current()->len);
	assert_string_equal("\"a", menu_get_current()->items[0]);
	assert_string_equal("1", menu_get_current()->items[1]);
	assert_string_equal("2", menu_get_current()->items[2]);
}

/* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
/* vim: set cinoptions+=t0 : */
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