Skip to content

Commit

Permalink
add test for parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-rubio committed Jun 25, 2015
1 parent c03c56a commit 76fd69e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ephp_error.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ handle_error(Context, {error, Type, Index, Data}) ->

get_message(eparse, Line, Filename) ->
io_lib:format(
"~nParse Error: parse error in ~s on line ~p~n",
"~nParse error: parse error in ~s on line ~p~n",
[Filename, Line]);

get_message(erequired, Line, {File, ReqFile}) ->
Expand Down
2 changes: 2 additions & 0 deletions test/code/test_parse_error.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Parse error: parse error in {{CWD}}/test/code/test_parse_error.php on line 3
4 changes: 4 additions & 0 deletions test/code/test_parse_error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php

this is a parser error!

1 change: 1 addition & 0 deletions test/ephp_code_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ code_to_test_() ->
"strings_01",
"template_01",
"text_op",
"test_parse_error",
"test_arith",
"test_concat_number",
"test_cond",
Expand Down

0 comments on commit 76fd69e

Please sign in to comment.