Skip to content

Commit

Permalink
Fix editorconfig#12 Add a test for "unset" value
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Nov 13, 2017
1 parent 85d8749 commit dd28435
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
15 changes: 12 additions & 3 deletions filetree/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#
# Copyright (c) 2011-2012 EditorConfig Team
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Expand Down Expand Up @@ -84,3 +84,12 @@ if(NOT WIN32)
endif()

new_ec_test(path_with_special_chars path_with_special_chars.in "path_with_special_[chars/test.a" "^key=value[ \t\n\r]*$")

# Test the unset value with various common properties
new_ec_test(unset_charset unset.in unset/charset.txt "^charset=unset[ \t\n\r]*$")
new_ec_test(unset_end_of_line unset.in unset/end_of_line.txt "^end_of_line=unset[ \t\n\r]*$")
new_ec_test(unset_indent_size unset.in unset/indent_size.txt "^indent_size=unset[ \t\n\r]*tab_width=unset[ \t\n\r]*$")
new_ec_test(unset_indent_style unset.in unset/indent_style.txt "^indent_style=unset[ \t\n\r]*$")
new_ec_test(unset_insert_final_newline unset.in unset/insert_final_newline.txt "^insert_final_newline=unset[ \t\n\r]*$")
new_ec_test(unset_tab_width unset.in unset/tab_width.txt "^tab_width=unset[ \t\n\r]*$")
new_ec_test(unset_trim_trailing_whitespace unset.in unset/trim_trailing_whitespace.txt "^trim_trailing_whitespace=unset[ \t\n\r]*$")
22 changes: 22 additions & 0 deletions filetree/unset.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
root = true

[charset.txt]
charset=utf-8

[end_of_line.txt]
end_of_line=lf

[indent_size.txt]
indent_size=2

[indent_style.txt]
indent_style=space

[insert_final_newline.txt]
insert_final_newline=true

[tab_width.txt]
tab_width=4

[trim_trailing_whitespace.txt]
trim_trailing_whitespace=true
21 changes: 21 additions & 0 deletions filetree/unset/unset.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

[charset.txt]
charset=unset

[end_of_line.txt]
end_of_line=unset

[indent_size.txt]
indent_size=unset

[indent_style.txt]
indent_style=unset

[insert_final_newline.txt]
insert_final_newline=unset

[tab_width.txt]
tab_width=unset

[trim_trailing_whitespace.txt]
trim_trailing_whitespace=unset

0 comments on commit dd28435

Please sign in to comment.