diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-11-24 11:33:20 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-11-24 14:51:13 +0100 |
commit | f59d5d1b62b1c2b2f505acc535c798e7c47974df (patch) | |
tree | 4712dc4ccd48c6fbc3b2406aa48c29e3bf359171 /test/test_choices.c | |
parent | 395a2534aca4a704da7501c5e79268420e41d174 (diff) |
Add support for restricting search/output to specific fields.fields
Diffstat (limited to 'test/test_choices.c')
-rw-r--r-- | test/test_choices.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/test_choices.c b/test/test_choices.c index d86bc12..b198d16 100644 --- a/test/test_choices.c +++ b/test/test_choices.c @@ -56,8 +56,8 @@ TEST test_choices_1() { choices_next(&choices); ASSERT_SIZE_T_EQ(0, choices.selection); - ASSERT(!strcmp(choices_get(&choices, 0), "tags")); - ASSERT_EQ(NULL, choices_get(&choices, 1)); + ASSERT(!strcmp(choices_get_search(&choices, 0), "tags")); + ASSERT_EQ(NULL, choices_get_search(&choices, 1)); PASS(); } @@ -85,7 +85,7 @@ TEST test_choices_2() { choices_search(&choices, "te"); ASSERT_SIZE_T_EQ(1, choices.available); ASSERT_SIZE_T_EQ(0, choices.selection); - ASSERT_STR_EQ("test", choices_get(&choices, 0)); + ASSERT_STR_EQ("test", choices_get_search(&choices, 0)); choices_next(&choices); ASSERT_SIZE_T_EQ(0, choices.selection); @@ -102,8 +102,8 @@ TEST test_choices_2() { choices_search(&choices, "ts"); ASSERT_SIZE_T_EQ(2, choices.available); ASSERT_SIZE_T_EQ(0, choices.selection); - ASSERT_STR_EQ("test", choices_get(&choices, 0)); - ASSERT_STR_EQ("tags", choices_get(&choices, 1)); + ASSERT_STR_EQ("test", choices_get_search(&choices, 0)); + ASSERT_STR_EQ("tags", choices_get_search(&choices, 1)); PASS(); } @@ -114,14 +114,14 @@ TEST test_choices_without_search() { ASSERT_SIZE_T_EQ(0, choices.available); ASSERT_SIZE_T_EQ(0, choices.selection); ASSERT_SIZE_T_EQ(0, choices.size); - ASSERT_EQ(NULL, choices_get(&choices, 0)); + ASSERT_EQ(NULL, choices_get_search(&choices, 0)); choices_add(&choices, "test"); ASSERT_SIZE_T_EQ(0, choices.available); ASSERT_SIZE_T_EQ(0, choices.selection); ASSERT_SIZE_T_EQ(1, choices.size); - ASSERT_EQ(NULL, choices_get(&choices, 0)); + ASSERT_EQ(NULL, choices_get_search(&choices, 0)); PASS(); } @@ -148,7 +148,7 @@ TEST test_choices_large_input() { /* Must match `seq 0 99999 | grep '.*1.*2.*' | wc -l` */ ASSERT_SIZE_T_EQ(8146, choices.available); - ASSERT_STR_EQ("12", choices_get(&choices, 0)); + ASSERT_STR_EQ("12", choices_get_search(&choices, 0)); for(int i = 0; i < N; i++) { free(strings[i]); |