forked from cory/tildefriends
Async File.writeFile.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3673 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
14
src/tests.c
14
src/tests.c
@ -506,6 +506,20 @@ static void _test_file(const tf_test_options_t* options)
|
||||
" exit(1);\n"
|
||||
"}).catch(function(error) {\n"
|
||||
" print('expected error', error);\n"
|
||||
"});\n"
|
||||
"File.writeFile('out/new.txt', 'hello').then(function(result) {\n"
|
||||
" File.readFile('out/new.txt').then(function(data) {\n"
|
||||
" print('READ', utf8Decode(data));\n"
|
||||
" if (utf8Decode(data) != 'hello') {\n"
|
||||
" exit(1);\n"
|
||||
" }\n"
|
||||
" }).catch(function(error) {\n"
|
||||
" print('unexpected read error', error);\n"
|
||||
" exit(1);\n"
|
||||
" });\n"
|
||||
"}).catch(function(error) {\n"
|
||||
" print('unexpected write error', error);\n"
|
||||
" exit(1);\n"
|
||||
"});\n");
|
||||
fclose(file);
|
||||
|
||||
|
Reference in New Issue
Block a user