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.
Commit d1b8da211249401fbdd0654cfdb5f2d905922c7b

Test ft_assoc_exists() more thoroughly
Author: xaizek
Author date (UTC): 2025-09-03 08:56
Committer name: xaizek
Committer date (UTC): 2025-09-03 08:57
Parent(s): 364cca5ca0f17db2a8b388302c11484eba0ffb3c
Signing key: 99DC5E4DB05F6BE2
Tree: d1ae02aaa40d58474016fe5e21c5ac2681a48b3b
File Lines added Lines deleted
tests/filetype/filetype.c 14 0
File tests/filetype/filetype.c changed (mode: 100644) (index 94086afbe..fd0411d4d)
... ... TEST(existence_check)
178 178 assert_true(ft_assoc_exists(&filetypes, "*.git", "{}tig")); assert_true(ft_assoc_exists(&filetypes, "*.git", "{}tig"));
179 179 assert_true(ft_assoc_exists(&filetypes, "*.git", "{help text}tig")); assert_true(ft_assoc_exists(&filetypes, "*.git", "{help text}tig"));
180 180 assert_true(ft_assoc_exists(&filetypes, "*.git", "{help text}\t tig")); assert_true(ft_assoc_exists(&filetypes, "*.git", "{help text}\t tig"));
181
182 /* Multiple programs and comma escaping. */
183 assoc_programs("*.png", "p1, p2,,", 0, 0);
184 assert_true(ft_assoc_exists(&filetypes, "*.png", "p1"));
185 assert_true(ft_assoc_exists(&filetypes, "*.png", "p2,,"));
186
187 /* Multiple matchers must have the same structure and all elements. */
188 assoc_programs("{*.mp3},{*.flac}", "mplayer", 0, 0);
189 assert_false(ft_assoc_exists(&filetypes, "{*.mp3}", "mplayer"));
190 assert_false(ft_assoc_exists(&filetypes, "{*.flac}", "mplayer"));
191 assert_false(ft_assoc_exists(&filetypes, "*.mp3,*.flac", "mplayer"));
192 assert_false(ft_assoc_exists(&filetypes, "{*.mp3,*.flac}", "mplayer"));
193 assert_false(ft_assoc_exists(&filetypes, "{*.flac},{*.mp3}", "mplayer"));
194 assert_true(ft_assoc_exists(&filetypes, "{*.mp3},{*.flac}", "mplayer"));
181 195 } }
182 196
183 197 TEST(pattern_list, IF(has_mime_type_detection)) TEST(pattern_list, IF(has_mime_type_detection))
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