Skip to content

Commit

Permalink
Make sure that parsers accept empty .editorconfig files and files con…
Browse files Browse the repository at this point in the history
…taining only comments and newlines (#42)

Close editorconfig/editorconfig#433
  • Loading branch information
ppalaga authored Jun 19, 2020
1 parent 6c8fe68 commit db8833f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,9 @@ new_ec_test(max_property_value limits.in test2
# Test max section names
new_ec_test(max_section_name_ok limits.in test3 "^key=value[ \t\n\r]*$")
new_ec_test(max_section_name_ignore limits.in test4 "^[ \t\n\r]*$")

# Empty .editorconfig files
new_ec_test(empty_editorconfig_file empty.in test4 "^[ \t\n\r]*$")
new_ec_test(newlines_only_editorconfig_file newlines_only.in test4 "^[ \t\n\r]*$")
new_ec_test(comments_only_editorconfig_file comments_only.in test4 "^[ \t\n\r]*$")
new_ec_test(comments_and_newlines_editorconfig_file comments_and_newlines.in test4 "^[ \t\n\r]*$")
4 changes: 4 additions & 0 deletions parser/comments_and_newlines.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

# Just comments

# ... and newlines
1 change: 1 addition & 0 deletions parser/comments_only.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Just a comment, nothing else
Empty file added parser/empty.in
Empty file.
2 changes: 2 additions & 0 deletions parser/newlines_only.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


0 comments on commit db8833f

Please sign in to comment.