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 / utils / functional.c (1c78544cec186e616078d05166f7b41d553ca37a) (1,264B) (mode 100644) [raw]
#include <stic.h>

#include <ctype.h> /* isdigit() */

#include "../../src/utils/macros.h"

static int
less_than_5(int x)
{
    return x < 5;
}

TEST(all_all_are_true)
{
	assert_int_equal(1, ALL(less_than_5, 1, -2, 3));
	assert_int_equal(1, ALL(isdigit, '1', '9'));
}

TEST(all_all_are_false)
{
	assert_int_equal(0, ALL(less_than_5, 10, 20, 30));
}

TEST(all_one_is_true)
{
	assert_int_equal(0, ALL(less_than_5, 10, 0, 30));
	assert_int_equal(0, ALL(isdigit, 'z', '9'));
}

TEST(none_all_are_true)
{
	assert_int_equal(0, NONE(less_than_5, 1, -2, 3));
	assert_int_equal(0, NONE(isdigit, '1', '9'));
}

TEST(none_all_are_false)
{
	assert_int_equal(1, NONE(less_than_5, 10, 20, 30));
	assert_int_equal(1, NONE(isdigit, 'z', 'a'));
}

TEST(none_one_is_true)
{
	assert_int_equal(0, NONE(less_than_5, 10, 0, 30));
}

TEST(any_all_are_true)
{
	assert_int_equal(1, ANY(less_than_5, 1, -2, 3));
}

TEST(any_all_are_false)
{
	assert_int_equal(0, ANY(less_than_5, 10, 20, 30));
	assert_int_equal(0, ANY(isdigit, 'z', 'a'));
}

TEST(any_one_is_true)
{
	assert_int_equal(1, ANY(less_than_5, 10, 0, 30));
	assert_int_equal(1, ANY(isdigit, 'z', '9'));
}

/* 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