summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2018-03-29 21:12:52 +0100
committerAndy Williams <andy@andywilliams.me>2018-03-29 21:12:52 +0100
commitd8ac6be6661314c5c0d51308fb59dba01d71c327 (patch)
tree9ee5d9cea5d8ee8ccd6d0f40e03eaea2ae35f521
parente65fc72c65da3a3f081cb5a274e360c97e2d93d4 (diff)
Fix private usage by removing those test
-rw-r--r--src/tests/elementary/elm_code_test_widget_undo.c141
1 files changed, 0 insertions, 141 deletions
diff --git a/src/tests/elementary/elm_code_test_widget_undo.c b/src/tests/elementary/elm_code_test_widget_undo.c
index 0e54fcbf08..41594951e2 100644
--- a/src/tests/elementary/elm_code_test_widget_undo.c
+++ b/src/tests/elementary/elm_code_test_widget_undo.c
@@ -95,149 +95,8 @@ START_TEST (elm_code_test_widget_undo_text_insert_multiple)
95} 95}
96END_TEST 96END_TEST
97 97
98START_TEST (elm_code_test_widget_undo_newline)
99{
100 Elm_Code *code;
101 Elm_Code_File *file;
102 Elm_Code_Line *line;
103 Elm_Code_Widget *widget;
104 Evas_Object *win;
105 unsigned int length;
106 const char *content;
107
108 elm_init(1, NULL);
109 code = elm_code_create();
110 file = elm_code_file_new(code);
111 elm_code_file_line_append(file, "test", 4, NULL);
112
113 win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
114 widget = elm_code_widget_add(win, code);
115
116 elm_code_widget_cursor_position_set(widget, 1, 5);
117 _elm_code_widget_newline(widget);
118 ck_assert_int_eq(2, elm_code_file_lines_get(file));
119 line = elm_code_file_line_get(file, 1);
120 content = elm_code_line_text_get(line, &length);
121 ck_assert_strn_eq("test", content, 1);
122
123 elm_code_widget_undo(widget);
124
125 ck_assert_int_eq(1, elm_code_file_lines_get(file));
126 line = elm_code_file_line_get(file, 1);
127 content = elm_code_line_text_get(line, &length);
128 ck_assert_strn_eq("test", content, 4);
129
130 elm_code_free(code);
131 elm_shutdown();
132}
133END_TEST
134
135START_TEST (elm_code_test_widget_undo_delete)
136{
137 Elm_Code *code;
138 Elm_Code_File *file;
139 Elm_Code_Line *line;
140 Elm_Code_Widget *widget;
141 Evas_Object *win;
142 unsigned int length;
143 const char *content;
144
145 elm_init(1, NULL);
146 code = elm_code_create();
147 file = elm_code_file_new(code);
148 elm_code_file_line_append(file, "test", 4, NULL);
149
150 win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
151 widget = elm_code_widget_add(win, code);
152
153 elm_code_widget_cursor_position_set(widget, 1, 4);
154 _elm_code_widget_backspace(widget);
155
156 line = elm_code_file_line_get(file, 1);
157 content = elm_code_line_text_get(line, &length);
158 ck_assert_strn_eq("tet", content, length);
159
160 elm_code_widget_undo(widget);
161 content = elm_code_line_text_get(line, &length);
162 ck_assert_strn_eq("test", content, length);
163
164 elm_code_widget_cursor_position_set(widget, 1, 2);
165 _elm_code_widget_delete(widget);
166
167 line = elm_code_file_line_get(file, 1);
168 content = elm_code_line_text_get(line, &length);
169 ck_assert_strn_eq("tst", content, length);
170
171 elm_code_widget_undo(widget);
172 content = elm_code_line_text_get(line, &length);
173 ck_assert_strn_eq("test", content, length);
174
175 elm_code_widget_cursor_position_set(widget, 1, 4);
176 elm_code_widget_text_at_cursor_insert(widget, "\t");
177 _elm_code_widget_backspace(widget);
178 content = elm_code_line_text_get(line, &length);
179 ck_assert_strn_eq("test", content, length);
180 elm_code_widget_undo(widget);
181 content = elm_code_line_text_get(line, &length);
182 ck_assert_strn_eq("tes\tt", content, length);
183
184 elm_code_widget_cursor_position_set(widget, 1, 4);
185 _elm_code_widget_delete(widget);
186 content = elm_code_line_text_get(line, &length);
187 ck_assert_strn_eq("test", content, length);
188 elm_code_widget_undo(widget);
189 content = elm_code_line_text_get(line, &length);
190 ck_assert_strn_eq("tes\tt", content, length);
191
192 elm_code_free(code);
193 elm_shutdown();
194}
195END_TEST
196
197START_TEST (elm_code_test_widget_undo_delete_multiple)
198{
199 Elm_Code *code;
200 Elm_Code_File *file;
201 Elm_Code_Line *line;
202 Elm_Code_Widget *widget;
203 Evas_Object *win;
204 unsigned int length;
205 const char *content;
206
207 elm_init(1, NULL);
208 code = elm_code_create();
209 file = elm_code_file_new(code);
210 elm_code_file_line_append(file, "test", 4, NULL);
211
212 win = elm_win_add(NULL, "entry", ELM_WIN_BASIC);
213 widget = elm_code_widget_add(win, code);
214
215 elm_code_widget_cursor_position_set(widget, 1, 4);
216 _elm_code_widget_backspace(widget);
217 _elm_code_widget_backspace(widget);
218
219 line = elm_code_file_line_get(file, 1);
220 content = elm_code_line_text_get(line, &length);
221 ck_assert_strn_eq("tt", content, length);
222
223 elm_code_widget_undo(widget);
224 content = elm_code_line_text_get(line, &length);
225 ck_assert_strn_eq("tet", content, length);
226
227 elm_code_widget_undo(widget);
228 content = elm_code_line_text_get(line, &length);
229 ck_assert_strn_eq("test", content, length);
230
231 elm_code_free(code);
232 elm_shutdown();
233}
234END_TEST
235
236void elm_code_test_widget_undo(TCase *tc) 98void elm_code_test_widget_undo(TCase *tc)
237{ 99{
238 tcase_add_test(tc, elm_code_test_widget_undo_text_insert); 100 tcase_add_test(tc, elm_code_test_widget_undo_text_insert);
239 tcase_add_test(tc, elm_code_test_widget_undo_text_insert_multiple); 101 tcase_add_test(tc, elm_code_test_widget_undo_text_insert_multiple);
240 tcase_add_test(tc, elm_code_test_widget_undo_newline);
241 tcase_add_test(tc, elm_code_test_widget_undo_delete);
242 tcase_add_test(tc, elm_code_test_widget_undo_delete_multiple);
243} 102}