summaryrefslogtreecommitdiff
path: root/src/tests/elementary/elm_code_test_basic.c
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-05-16 23:19:34 +0100
committerAndy Williams <andy@andywilliams.me>2017-05-16 23:19:34 +0100
commitac076be75d125df9353c1a8cdcf970a9a01db370 (patch)
tree792f01bc80975c275be3e8c9b35636515fd02301 /src/tests/elementary/elm_code_test_basic.c
parenteb04ab591cf294517bf47782779087b21af919b5 (diff)
elm_code: Add a save_as API call for writing buffers to a new file
Diffstat (limited to '')
-rw-r--r--src/tests/elementary/elm_code_test_basic.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tests/elementary/elm_code_test_basic.c b/src/tests/elementary/elm_code_test_basic.c
index 5f6827b..887db8d 100644
--- a/src/tests/elementary/elm_code_test_basic.c
+++ b/src/tests/elementary/elm_code_test_basic.c
@@ -42,9 +42,28 @@ START_TEST (elm_code_open_test)
42} 42}
43END_TEST 43END_TEST
44 44
45START_TEST (elm_code_save_as_test)
46{
47 char *path = TESTS_SRC_DIR "/testfile.txt";
48 char *dest = "/tmp/dest.txt";
49 Elm_Code *code;
50
51 elm_init(1, NULL);
52 code = elm_code_create();
53 elm_code_file_open(code, path);
54
55 elm_code_file_save_as(code->file, dest);
56 ck_assert(ecore_file_exists(dest));
57
58 ecore_file_remove(dest);
59 elm_code_free(code);
60 elm_shutdown();
61}
62END_TEST
45 63
46void elm_code_test_basic(TCase *tc) 64void elm_code_test_basic(TCase *tc)
47{ 65{
48 tcase_add_test(tc, elm_code_create_test); 66 tcase_add_test(tc, elm_code_create_test);
49 tcase_add_test(tc, elm_code_open_test); 67 tcase_add_test(tc, elm_code_open_test);
68 tcase_add_test(tc, elm_code_save_as_test);
50} 69}