@@ -66,6 +66,8 @@ file(Filename) ->
66
66
case conf_parse :file (Filename ) of
67
67
{error , Reason } ->
68
68
{error , [{error , ? FMT (" Could not open file (~s ) for Reason ~s " , [Filename , Reason ])}]};
69
+ {_Conf , Remainder , {{line , L }, {column , C }}} when is_binary (Remainder ) ->
70
+ {error , [{error , ? FMT (" Syntax error in ~s after line ~p column ~p , parsing incomplete" , [Filename , L , C ])}]};
69
71
Conf ->
70
72
% % Conf is a proplist, check if any of the values are cuttlefish_errors
71
73
{_ , Values } = lists :unzip (Conf ),
@@ -273,6 +275,11 @@ files_one_nonent_test() ->
273
275
? assertEqual ({error ,[{error ," Could not open file (../test/nonent.conf) for Reason enoent" }]}, Conf ),
274
276
ok .
275
277
278
+ files_incomplete_parse_test () ->
279
+ Conf = file (" ../test/incomplete.conf" ),
280
+ ? assertEqual ({error , [{error ," Syntax error in ../test/incomplete.conf after line 3 column 1, parsing incomplete" }]}, Conf ),
281
+ ok .
282
+
276
283
generate_element_level_advanced_test () ->
277
284
cuttlefish_lager_test_backend :bounce (warning ),
278
285
assert_no_output ({level , advanced }),
0 commit comments