about summary refs log tree commit diff stats
path: root/sandbox/007-sandbox-delete.mu
Commit message (Expand)AuthorAgeFilesLines
* 4261 - start using literals for 'true' and 'false'Kartik Agaram2018-06-171-3/+3
* 4134 - 'input' = 'ingredient'Kartik K. Agaram2017-12-031-3/+3
* 3902 - drop redundant redraw of recipe side on F4Kartik K. Agaram2017-06-091-0/+1
* 3860 - stop buffering the screen in termboxKartik K. Agaram2017-05-181-2/+0
* 3854Kartik K. Agaram2017-05-131-0/+2
* 3824 - experiment: stop buffering in termboxKartik K. Agaram2017-04-161-2/+0
* 3705 - switch to tested file-system primitivesKartik K. Agaram2016-12-111-16/+26
* 3656Kartik K. Agaram2016-11-101-1/+1
* 3552Kartik K. Agaram2016-10-221-1/+1
* 3490Kartik K. Agaram2016-10-091-24/+24
* 3489Kartik K. Agaram2016-10-081-24/+24
* 3457Kartik K. Agaram2016-10-061-24/+24
* 3445Kartik K. Agaram2016-10-061-16/+16
* 3429 - standardize Mu scenariosKartik K. Agaram2016-09-281-25/+25
* 3396Kartik K. Agaram2016-09-171-29/+29
* 3391 - type abbreviations everywhereKartik K. Agaram2016-09-171-39/+39
* 3337 - first use of type abbreviations: textKartik K. Agaram2016-09-121-10/+10
* 3054 - keep cursor stable on resize in sandbox/Kartik K. Agaram2016-06-121-5/+5
* 2983 - migrate buttons over to sandbox/Kartik K. Agaram2016-05-191-127/+133
* 2953 - use pgup/pgdn to scroll through sandboxesKartik K. Agaram2016-05-111-6/+6
* 2864 - replace all address:shared with just addressKartik K. Agaram2016-04-241-33/+33
* 2861 - 'maybe-convert' no longer returns addressKartik K. Agaram2016-04-231-1/+1
* 2854 - purge get-address from sandbox/ appKartik K. Agaram2016-04-221-15/+36
* 2735 - define recipes using 'def'Kartik K. Agaram2016-03-081-4/+4
* 2608 - fix-up tests in sandbox/ appKartik K. Agaram2016-01-271-12/+4
* 2594 - bugfixes: managing state when deletingKartik K. Agaram2016-01-231-2/+213
* 2590 - support scrolling through sandboxesKartik K. Agaram2016-01-221-1/+1
* 2585 - label sandboxes with a numberKartik K. Agaram2016-01-221-3/+3
* 2576 - distinguish allocated addresses from othersKartik K. Agaram2016-01-191-9/+9
* support immutability checks in sandbox/ appKartik K. Agaram2015-12-151-1/+1
* 2428 - sandbox/ working againKartik K. Agaram2015-11-121-4/+2
* 2309Kartik K. Agaram2015-10-281-4/+4
* 2260 - start tracing by depth rather than labelKartik K. Agaram2015-10-061-1/+1
* 2183 - environment + external editor using tmuxKartik K. Agaram2015-09-121-0/+108
6:16:46 +0000 Moved autocomplete tests to cmocka' href='/danisanti/profani-tty/commit/tests/test_autocomplete.c?id=3a403046ff241381e0f9750dfe39f1e05c73fd63'>3a403046 ^
eb5b04df ^
527e739a ^
545a23e9 ^
527e739a ^
eb5b04df ^
a9a860cb ^
f5338158 ^
527e739a ^
eb5b04df ^

3a403046 ^
eb5b04df ^
527e739a ^
545a23e9 ^

527e739a ^
eb5b04df ^
3a403046 ^
6bad38c2 ^
527e739a ^
eb5b04df ^

3a403046 ^
eb5b04df ^
527e739a ^
545a23e9 ^

527e739a ^

eb5b04df ^
3a403046 ^
6bad38c2 ^
527e739a ^
eb5b04df ^

3a403046 ^
4be250ae ^
527e739a ^
545a23e9 ^

527e739a ^
4be250ae ^
3a403046 ^
4be250ae ^
527e739a ^
4be250ae ^

3a403046 ^
4be250ae ^
527e739a ^
545a23e9 ^

527e739a ^
4be250ae ^
3a403046 ^
4be250ae ^
527e739a ^
4be250ae ^

3a403046 ^
4be250ae ^
527e739a ^
545a23e9 ^

527e739a ^
4be250ae ^




3a403046 ^
4be250ae ^
527e739a ^
4be250ae ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
                 




                   

                    
                               
 
                              
 

                                         

 
                                     
 


                                         

 
                                    
 


                                         

 
                                                
 

                                               
 
                        
 
                           

 
                                       
 
                                         
                                  
                                                    
 
                                         
 
                           

 
                                                     
 
                                         

                                  
                                                    
 
                                         
 
                           

 
                                                      
 
                                         

                                  

                                                       
 
                                         
 
                           

 
                                   
 
                                         

                                  
                                               
 
                                                
 
                           

 
                                        
 
                                         

                                  
                                               
 
                                                
 
                           

 
                                       
 
                                         

                                  
                                               




                                           
                                      
 
                           
 
#include <glib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <cmocka.h>
#include <stdlib.h>

#include "contact.h"
#include "tools/autocomplete.h"

void clear_empty(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_clear(ac);
}

void reset_after_create(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_reset(ac);
    autocomplete_clear(ac);
}

void find_after_create(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_complete(ac, "hello");
    autocomplete_clear(ac);
}

void get_after_create_returns_null(void **state)
{
    Autocomplete ac = autocomplete_new();
    GSList *result = autocomplete_get_list(ac);

    assert_null(result);

    autocomplete_clear(ac);
}

void add_one_and_complete(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_add(ac, "Hello");
    char *result = autocomplete_complete(ac, "Hel");

    assert_string_equal("Hello", result);

    autocomplete_clear(ac);
}

void add_two_and_complete_returns_first(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_add(ac, "Hello");
    autocomplete_add(ac, "Help");
    char *result = autocomplete_complete(ac, "Hel");

    assert_string_equal("Hello", result);

    autocomplete_clear(ac);
}

void add_two_and_complete_returns_second(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_add(ac, "Hello");
    autocomplete_add(ac, "Help");
    char *result1 = autocomplete_complete(ac, "Hel");
    char *result2 = autocomplete_complete(ac, result1);

    assert_string_equal("Help", result2);

    autocomplete_clear(ac);
}

void add_two_adds_two(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_add(ac, "Hello");
    autocomplete_add(ac, "Help");
    GSList *result = autocomplete_get_list(ac);

    assert_int_equal(2, g_slist_length(result));

    autocomplete_clear(ac);
}

void add_two_same_adds_one(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_add(ac, "Hello");
    autocomplete_add(ac, "Hello");
    GSList *result = autocomplete_get_list(ac);

    assert_int_equal(1, g_slist_length(result));

    autocomplete_clear(ac);
}

void add_two_same_updates(void **state)
{
    Autocomplete ac = autocomplete_new();
    autocomplete_add(ac, "Hello");
    autocomplete_add(ac, "Hello");
    GSList *result = autocomplete_get_list(ac);

    GSList *first = g_slist_nth(result, 0);

    char *str = first->data;

    assert_string_equal("Hello", str);

    autocomplete_clear(ac);
}