pax_global_header00006660000000000000000000000064134555347660014534gustar00rootroot0000000000000052 comment=a51e13791bd76c099e323b567a3278e450453a14 editorconfig-core-test-0.13/000077500000000000000000000000001345553476600160365ustar00rootroot00000000000000editorconfig-core-test-0.13/.editorconfig000066400000000000000000000002541345553476600205140ustar00rootroot00000000000000[CMakeLists.txt] trim_trailing_whitespace = true indent_style = space indent_size = 4 [*.in] trim_trailing_whitespace = false [*.md] indent_style = space indent_size = 4 editorconfig-core-test-0.13/.gitignore000066400000000000000000000002501345553476600200230ustar00rootroot00000000000000# Generated by CMake CMakeCache.txt CMakeFiles Makefile cmake_install.cmake install_manifest.txt # Generated by CTest /Testing CTestTestfile.cmake # Eclipse .project editorconfig-core-test-0.13/CMakeLists.txt000066400000000000000000000100221345553476600205710ustar00rootroot00000000000000# # Copyright (c) 2011-2018 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # Don't check any language compiler. This project is for EditorConfig Core # testing only. project(editorconfig-core-test NONE) # Where this file lives set(tests_cmakelists_dir "${CMAKE_CURRENT_LIST_DIR}") #message(STATUS "Tests are in ${tests_cmakelists_dir}") # Only when we are using editorconfig-core-test independently should we check # cmake version, set EDITORCONFIG_CMD as cache string, and enable_testing() # here. if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) cmake_minimum_required(VERSION 3.5) set(EDITORCONFIG_CMD "editorconfig" CACHE STRING "editorconfig command.") enable_testing() endif() # The most common test function function(new_ec_test name ec_file src_file regex) add_test(${name} ${EDITORCONFIG_CMD} -f ${ec_file} "${CMAKE_CURRENT_SOURCE_DIR}/${src_file}") set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}") endfunction() # The tests that requires version specified function(new_ec_test_version name ec_file src_file regex version) add_test(${name} ${EDITORCONFIG_CMD} -b ${version} -f ${ec_file} "${CMAKE_CURRENT_SOURCE_DIR}/${src_file}") set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}") endfunction() # The tests that requires the full path EditorConfig files function(new_ec_test_full_ec_file_path name ec_file src_file regex) add_test(${name} ${EDITORCONFIG_CMD} -f ${ec_file} "${src_file}") set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}") endfunction() # A test that returns multiple lines of output. CAUTION: filenames used in # these tests may not contain semicolons. function(new_ec_test_multiline name ec_file src_file regex) #message(STATUS "Building multiline test ${name} with tests_cmakelists_dir ${tests_cmakelists_dir}") #message(STATUS "List dir ${CMAKE_CURRENT_LIST_DIR}, source dir ${CMAKE_CURRENT_SOURCE_DIR}") add_test(${name} "cmake" "-D" "EDITORCONFIG_CMD=${EDITORCONFIG_CMD}" # Since variables aren't autpmatically passed to the inner cmake "-D" "ECARGS:LIST=-f;${ec_file};${CMAKE_CURRENT_SOURCE_DIR}/${src_file}" # Note: the semicolons separate list elements. "-P" "${tests_cmakelists_dir}/cmake/ec_sort.cmake") set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "^[\n]*${regex}$") # Permit leading \n's because I can't always get rid of them using # only CMake-provided facilities. endfunction() # First, make sure the test harness works. add_subdirectory(meta) # Then test the core. add_subdirectory(glob) add_subdirectory(properties) add_subdirectory(parser) add_subdirectory(filetree) add_subdirectory(cli) editorconfig-core-test-0.13/LICENSE.txt000066400000000000000000000024351345553476600176650ustar00rootroot00000000000000Copyright (c) 2011-2018 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 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. editorconfig-core-test-0.13/README.md000066400000000000000000000023301345553476600173130ustar00rootroot00000000000000This project is a series of testing for [EditorConfig Core][editorconfig]. Please have [cmake][] installed before using this project. ### Use editorconfig-core-test independently After installing cmake, switch to the root dir of this project, and execute: cmake -DEDITORCONFIG_CMD=the_editorconfig_core_cmd_you_want_to_test . After that, if testing files are generated successfully, execute `ctest .` to start testings. ### Use editorconfig-core-test in your project as a git submodule If you are using [git][] and cmake to manage your project, this method should be suitable for you. Suppose that you will add editorconfig-core-test repo as a submodule in your root directory. First add editorconfig-core-test as a gitsubmodule in your repo by execute: git submodule add git://github.com/editorconfig/editorconfig-core-test.git tests Then add the following lines to your project root `CMakeLists.txt`: ```cmake enable_testing() set(EDITORCONFIG_CMD the_editorconfig_core_path) add_subdirectory(tests) ``` Now after executing `cmake .` in you project root dir, you should be able to run the testings by executing `ctest .`. [cmake]: http://www.cmake.org [editorconfig]: http://editorconfig.org [git]: http://git-scm.com editorconfig-core-test-0.13/cli/000077500000000000000000000000001345553476600166055ustar00rootroot00000000000000editorconfig-core-test-0.13/cli/CMakeLists.txt000066400000000000000000000053161345553476600213520ustar00rootroot00000000000000# # Copyright (c) 2011-2018 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # Tests for version switches # test --version option returns version information add_test(test_long_version_switch ${EDITORCONFIG_CMD} --version) set_tests_properties(test_long_version_switch PROPERTIES PASS_REGULAR_EXPRESSION "^EditorConfig.* Version [0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+)?[ \t\n\r]$") # test -v option returns version information add_test(test_short_version_switch ${EDITORCONFIG_CMD} -v) set_tests_properties(test_short_version_switch PROPERTIES PASS_REGULAR_EXPRESSION "^EditorConfig.* Version [0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+)?[ \t\n\r]$") # Test for multiple input files # when files are specified on command line. The files can appear in either # order in the output, but each file's output line must be grouped with its # file header. Handle this by listing both possibilities manually in the regex. add_test(multiple_files_on_command_line ${EDITORCONFIG_CMD} -f cli.in "${CMAKE_CURRENT_SOURCE_DIR}/file1.c" "${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp") set_tests_properties(multiple_files_on_command_line PROPERTIES PASS_REGULAR_EXPRESSION "^(\\[${CMAKE_CURRENT_SOURCE_DIR}/file1.c\\][ \t]*[\n\r]+key1=value1[ \t]*[\n\r]+\\[${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp\\][ \t]*[\n\r]+key2=value2)|(\\[${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp\\][ \t]*[\n\r]+key2=value2[ \t]*[\n\r]+\\[${CMAKE_CURRENT_SOURCE_DIR}/file1.c\\][ \t]*[\n\r]+key1=value1)[ \t\n\r]*$" ) editorconfig-core-test-0.13/cli/cli.in000066400000000000000000000000701345553476600177010ustar00rootroot00000000000000root = true [*.c] key1 = value1 [*.cpp] key2 = value2 editorconfig-core-test-0.13/cmake/000077500000000000000000000000001345553476600171165ustar00rootroot00000000000000editorconfig-core-test-0.13/cmake/almostcat.cmake000077500000000000000000000037761345553476600221270ustar00rootroot00000000000000# almostcat.cmake: print the file named in ${WHICH} to **stderr**. Puts an # extra space at the beginning to suppress CMake's word wrapping. May add # an extra \n at the end because that's what message() does. # BSD-2-Clause # Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com) # 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.5) if("${WHICH}" STREQUAL "") message(FATAL_ERROR "No WHICH parameter specified") return() endif() #message(FATAL_ERROR " Reading ${WHICH}") # Uncomment for debugging file(READ "${WHICH}" contents) # message() will give us an extra \n, so trim one if we can. string(REGEX REPLACE "(\r\n|\r|\n)$" "" lines "${lines}") # Print, with a leading space as noted above. message(" ${contents}") editorconfig-core-test-0.13/cmake/ec_sort.cmake000077500000000000000000000055771345553476600215770ustar00rootroot00000000000000# ec_sort.cmake: Run editorconfig and sort its output # For use in editorconfig; see # https://github.com/editorconfig/editorconfig/issues/375 . # Call as, e.g.: # cmake -D EDITORCONFIG_CMD="../editorconfig" -D ECARGS:LIST="-f;.editorconfig;foo" -P cmake/ec_sort.cmake # EDITORCONFIG_CMD may also be list-valued. EDITORCONFIG_CMD and ECARGS # are put together on the command line, in that order, and split by CMake. # BSD-2-Clause # Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com) # 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.5) # See documentation links at https://stackoverflow.com/q/12802377/2877364 set(tests_cmake_ec_sort_dir "${CMAKE_CURRENT_LIST_DIR}") list(APPEND CMAKE_MODULE_PATH "${tests_cmake_ec_sort_dir}/../cmake") include(runandsort) # Required parameters are in variables: EDITORCONFIG_CMD and ECARGS if("${EDITORCONFIG_CMD}" STREQUAL "") message(FATAL_ERROR "No EDITORCONFIG_CMD parameter specified") return() endif() if("${ECARGS}" STREQUAL "") message(FATAL_ERROR "No ECARGS parameter specified") return() endif() # Uncomment for debugging #message(FATAL_ERROR " Running ${EDITORCONFIG_CMD} with ${ECARGS}") run_and_sort(RETVAL lines RETVAL_FAILURE did_fail CMDLINE ${EDITORCONFIG_CMD} ${ECARGS} ) if(${did_fail}) message(FATAL_ERROR "${EDITORCONFIG_CMD} ${ECARGS} returned a nonzero exit code") return() endif() # message() will give us an extra \n, so trim one if we can. string(REGEX REPLACE "(\r\n|\r|\n)$" "" lines "${lines}") # Output **to stderr**. If we used message(STATUS...), it would print to # stdout but also emit a leading "--". message("${lines}") editorconfig-core-test-0.13/cmake/runandsort.cmake000077500000000000000000000121121345553476600223170ustar00rootroot00000000000000# runandsort.cmake: Run a program and sort its output # For use in editorconfig; see # https://github.com/editorconfig/editorconfig/issues/375 . # BSD-2-Clause # Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com) # 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.5) # Conventions: # - "P_*" are parameters parsed using cmake_parse_arguments # - Any parameter called "RETVAL", "RETVAL_*", or "*_NAME" should be given # the name of a variable in the caller's scope into which to # store results. # Run a program with the given arguments, and return its sorted output as # a string. # CAUTION 1: May not produce correct output if any output line includes # a semicolon, because that is a list separator in CMake. # CAUTION 2: Depends on sort order of CMake; see discussion at # https://gitlab.kitware.com/cmake/cmake/issues/18551 # # Limitations: # Any \x01 in the string will be corrupted - this routine uses those to work # around CMake limitations. # Arguments: # RETVAL . . . . . . . The name of the variable to store the result in # CMDLINE . . . . . . . The program to run, and any arguments # RETVAL_FAILURE . . . . If present, a variable that will be set to TRUE # if PGM returns a non-zero exit code. # CAPTURE_STDERR . . . . If present, capture stderr instead of stdout # TRIM_INITIAL_LEADING_SPACE If present, remove initial spaces from the # first line. This is to work around a hack # in almostcat.cmake. # # Returns: # The sorted stdout of PGM, or the FAILURE string if PGM failed. # PGM's stderr is ignored. function(run_and_sort) # Argument parsing set(option_keywords CAPTURE_STDERR TRIM_INITIAL_LEADING_SPACE) set(one_value_keywords RETVAL RETVAL_FAILURE) set(multi_value_keywords CMDLINE ARGS) cmake_parse_arguments(P "${option_keywords}" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN}) #message(STATUS "Running ${P_CMDLINE}") execute_process(COMMAND ${P_CMDLINE} RESULT_VARIABLE ep_retval OUTPUT_VARIABLE ep_stdout ERROR_VARIABLE ep_stderr ) # Which one are we processing? if(${P_CAPTURE_STDERR}) set(ep_out "${ep_stderr}") else() set(ep_out "${ep_stdout}") endif() #message(STATUS "Got stdout =${ep_stdout}=") #message(STATUS "Got stderr =${ep_stderr}=") # Early bail on failure if(NOT("${ep_retval}" EQUAL "0")) set(${P_RETVAL} "" PARENT_SCOPE) if("${P_RETVAL_FAILURE}" MATCHES ".") # if we got a name set(${P_RETVAL_FAILURE} TRUE PARENT_SCOPE) endif() return() endif() # Trim hack if(${P_TRIM_INITIAL_LEADING_SPACE}) string(REGEX REPLACE "^[ ]+" "" ep_out "${ep_out}") endif() # Change all the semicolons in the output to \x01 string(ASCII 1 ONE) string(REPLACE ";" "${ONE}" ep_out "${ep_out}") #message(STATUS "After escaping =${ep_out}=") # Normalize line endings, just in case string(REGEX REPLACE "\r|\n|\r\n" "\n" ep_out "${ep_out}") #message(STATUS "After line-endings =${ep_out}=") # Turn the string into a list string(REPLACE "\n" ";" ep_out "${ep_out}") #message(STATUS "After listifying =${ep_out}=") # Sort the list list(SORT ep_out) # Back to individual lines string(REPLACE ";" "\n" ep_out "${ep_out}") #message(STATUS "After back to lines =${ep_out}=") # And back to semicolons. Note: I am not trying to reverse line endings. string(REPLACE "${ONE}" ";" ep_out "${ep_out}") #message(STATUS "After unescaping =${ep_out}=") # Out to the caller set(${P_RETVAL} "${ep_out}" PARENT_SCOPE) #message(STATUS "Returned =${ep_out}=") endfunction(run_and_sort) editorconfig-core-test-0.13/filetree/000077500000000000000000000000001345553476600176355ustar00rootroot00000000000000editorconfig-core-test-0.13/filetree/CMakeLists.txt000066400000000000000000000123471345553476600224040ustar00rootroot00000000000000# # Copyright (c) 2011-2018 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # cmake_minimum_required(VERSION 3.5) # Test for EditorConfig file in parent directory new_ec_test(parent_directory parent_directory.in parent_directory/test.a "^key=value[ \t\n\r]*$") # Test for EditorConfig file in parent directory and current directory new_ec_test_multiline(parent_and_current_dir_ML parent_directory.in parent_directory/test.b "key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*") # Test for file in parent directory and overloaded by file in current directory new_ec_test(parent_dir_overload parent_directory.in parent_directory/test.c "^key=valueB[ \t\n\r]*$") # Test for file in parent directory and overloaded by file in current directory and repeated in current directory new_ec_test(parent_dir_overload_repeat parent_directory.in parent_directory/test.d "^key=value_c[ \t\n\r]*$") # Test for file in parent directory and overloaded by file in current directory and repeated in current directory, with different patterns new_ec_test(parent_dir_overload_repeat2 parent_directory.in parent_directory/test.e "^key=value_g[ \t\n\r]*$") # Test that search stops at root EditorConfig file new_ec_test(root_file root_file.in root_file/test.a "^[ \t\n\r]*$") # Test that search stops at root EditorConfig file new_ec_test(root_file_mixed_case root_file.in root_mixed/test.a "^child=true[ \t\n\r]*$") # Test that search stops at root EditorConfig file new_ec_test(root_pattern root_file.in root "^name=root[ \t\n\r]*$") # Tests path separator match new_ec_test(path_separator path_separator.in path/separator "^key1=value1[ \t\n\r]*$") # Windows style path separator in the command line should work on Windows, but # should not work on other systems (including Cygwin) if(WIN32) set(path_separator_backslash_in_cmd_line_regex "^key1=value1[ \t\n\r]*$") else(WIN32) set(path_separator_backslash_in_cmd_line_regex "^[ \t\n\r]*$") endif(WIN32) new_ec_test_full_ec_file_path(path_separator_backslash_in_cmd_line path_separator.in "${CMAKE_CURRENT_SOURCE_DIR}\\\\path\\\\separator" ${path_separator_backslash_in_cmd_line_regex}) # Tests path separator match below top of path new_ec_test(nested_path_separator path_separator.in nested/path/separator "^[ \t\n\r]*$") # Tests path separator match top of path only new_ec_test(top_level_path_separator path_separator.in top/of/path "^key2=value2[ \t\n\r]*$") # Tests path separator match top of path only new_ec_test(top_level_path_separator_neg path_separator.in not/top/of/path "^[ \t\n\r]*$") # Test Windows-style path separator (backslash) does not work new_ec_test(windows_separator path_separator.in windows/separator "^[ \t\n\r]*$") # Test again that Windows-style path separator (backslash) does not work new_ec_test(windows_separator2 path_separator.in windows/separator2 "^[ \t\n\r]*$") # Globs with backslash in it but should be considered as file name on Non-Windows system if((NOT WIN32) AND (NOT CYGWIN)) new_ec_test(backslash_not_on_windows path_separator.in "windows\\\\separator2" "^key4=value4[ \t\n\r]*$") endif() new_ec_test(path_with_special_chars path_with_special_chars.in "path_with_special_[chars/test.a" "^key=value[ \t\n\r]*$") ## " <-- resync the syntax highlighter # 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_multiline(unset_indent_size_ML 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]*$") editorconfig-core-test-0.13/filetree/parent_directory.in000066400000000000000000000001671345553476600235460ustar00rootroot00000000000000root = true [test.a] key=value [test.b] key1=value1 [test.c] key=valueA [test.d] key=value_a [test.e] key=value_e editorconfig-core-test-0.13/filetree/parent_directory/000077500000000000000000000000001345553476600232125ustar00rootroot00000000000000editorconfig-core-test-0.13/filetree/parent_directory/parent_directory.in000066400000000000000000000001771345553476600271240ustar00rootroot00000000000000[test.b] key2=value2 [test.c] key=valueB [test.d] key=value_b [test.d] key=value_c [test.e] key=value_f [*.e] key=value_g editorconfig-core-test-0.13/filetree/path_separator.in000066400000000000000000000002431345553476600232000ustar00rootroot00000000000000; test for path separator root=true [path/separator] key1=value1 [/top/of/path] key2=value2 [windows\separator] key3=value3 [windows\\separator2] key4=value4 editorconfig-core-test-0.13/filetree/path_with_special_[chars/000077500000000000000000000000001345553476600246375ustar00rootroot00000000000000editorconfig-core-test-0.13/filetree/path_with_special_[chars/path_with_special_chars.in000066400000000000000000000000401345553476600320300ustar00rootroot00000000000000root = true [test.a] key=value editorconfig-core-test-0.13/filetree/root_file.in000066400000000000000000000000621345553476600221450ustar00rootroot00000000000000root = true [test.a] key=value [root] name=root editorconfig-core-test-0.13/filetree/root_file/000077500000000000000000000000001345553476600216175ustar00rootroot00000000000000editorconfig-core-test-0.13/filetree/root_file/root_file.in000066400000000000000000000000141345553476600241240ustar00rootroot00000000000000root = true editorconfig-core-test-0.13/filetree/root_mixed/000077500000000000000000000000001345553476600220065ustar00rootroot00000000000000editorconfig-core-test-0.13/filetree/root_mixed/root_file.in000066400000000000000000000000551345553476600243200ustar00rootroot00000000000000root = TrUe ignore = false [*.a] child=true editorconfig-core-test-0.13/filetree/unset.in000066400000000000000000000004441345553476600213250ustar00rootroot00000000000000root = 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 editorconfig-core-test-0.13/filetree/unset/000077500000000000000000000000001345553476600207735ustar00rootroot00000000000000editorconfig-core-test-0.13/filetree/unset/unset.in000066400000000000000000000004451345553476600224640ustar00rootroot00000000000000 [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 editorconfig-core-test-0.13/glob/000077500000000000000000000000001345553476600167615ustar00rootroot00000000000000editorconfig-core-test-0.13/glob/CMakeLists.txt000066400000000000000000000266451345553476600215360ustar00rootroot00000000000000# # Copyright (c) 2011-2018 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # Tests for * # matches a single characters new_ec_test_multiline(star_single_ML star.in ace.c "key=value[ \t\n\r]+keyc=valuec[ \t\n\r]*") # matches zero characters new_ec_test_multiline(star_zero_ML star.in ae.c "key=value[ \t\n\r]+keyc=valuec[ \t\n\r]*") # matches multiple characters new_ec_test_multiline(star_multiple_ML star.in abcde.c "key=value[ \t\n\r]+keyc=valuec[ \t\n\r]*") # does not match path separator new_ec_test(star_over_slash star.in a/e.c "^[ \t\n\r]*keyc=valuec[ \t\n\r]*$") # star after a slash new_ec_test_multiline(star_after_slash_ML star.in Bar/foo.txt "keyb=valueb[ \t\n\r]+keyc=valuec[ \t\n\r]*") # star matches a dot file after slash new_ec_test_multiline(star_matches_dot_file_after_slash_ML star.in Bar/.editorconfig "keyb=valueb[ \t\n\r]+keyc=valuec[ \t\n\r]*") # star matches a dot file new_ec_test(star_matches_dot_file star.in .editorconfig "^keyc=valuec[ \t\n\r]*$") # Tests for ? # matches a single character new_ec_test(question_single question.in some.c "^key=value[ \t\n\r]*$") # does not match zero characters new_ec_test(question_zero question.in som.c "^[ \t\n\r]*$") # does not match multiple characters new_ec_test(question_multiple question.in something.c "^[ \t\n\r]*$") # Tests for [ and ] # close bracket inside new_ec_test(brackets_close_inside brackets.in ].g "^close_inside=true[ \t\n\r]*$") # close bracket outside new_ec_test(brackets_close_outside brackets.in b].g "^close_outside=true[ \t\n\r]*$") # negative close bracket inside new_ec_test(brackets_nclose_inside brackets.in c.g "^close_inside=false[ \t\n\r]*$") # negative close bracket outside new_ec_test(brackets_nclose_outside brackets.in c].g "^close_outside=false[ \t\n\r]*$") # character choice new_ec_test(brackets_choice brackets.in a.a "^choice=true[ \t\n\r]*$") # character choice 2 new_ec_test(brackets_choice2 brackets.in c.a "^[ \t\n\r]*$") # negative character choice new_ec_test(brackets_nchoice brackets.in c.b "^choice=false[ \t\n\r]*$") # negative character choice 2 new_ec_test(brackets_nchoice2 brackets.in a.b "^[ \t\n\r]*$") # character range new_ec_test(brackets_range brackets.in f.c "^range=true[ \t\n\r]*$") # character range 2 new_ec_test(brackets_range2 brackets.in h.c "^[ \t\n\r]*$") # negative character range new_ec_test(brackets_nrange brackets.in h.d "^range=false[ \t\n\r]*$") # negative character range 2 new_ec_test(brackets_nrange2 brackets.in f.d "^[ \t\n\r]*$") # range and choice new_ec_test(brackets_range_and_choice brackets.in e.e "^range_and_choice=true[ \t\n\r]*$") # character choice with a dash new_ec_test(brackets_choice_with_dash brackets.in -.f "^choice_with_dash=true[ \t\n\r]*$") # slash inside brackets new_ec_test(brackets_slash_inside1 brackets.in ab/cd.i "^[ \t\n\r]*$") new_ec_test(brackets_slash_inside2 brackets.in abecd.i "^[ \t\n\r]*$") new_ec_test(brackets_slash_inside3 brackets.in ab[e/]cd.i "^slash_inside=true[ \t\n\r]*$") new_ec_test(brackets_slash_inside4 brackets.in ab[/c "^slash_half_open=true[ \t\n\r]*$") # Tests for { and } # word choice new_ec_test(braces_word_choice1 braces.in test.py "^choice=true[ \t\n\r]*$") new_ec_test(braces_word_choice2 braces.in test.js "^choice=true[ \t\n\r]*$") new_ec_test(braces_word_choice3 braces.in test.html "^choice=true[ \t\n\r]*$") new_ec_test(braces_word_choice4 braces.in test.pyc "^[ \t\n\r]*$") # single choice new_ec_test(braces_single_choice braces.in {single}.b "^choice=single[ \t\n\r]*$") new_ec_test(braces_single_choice_negative braces.in .b "^[ \t\n\r]*$") # empty choice new_ec_test(braces_empty_choice braces.in {}.c "^empty=all[ \t\n\r]*$") new_ec_test(braces_empty_choice_negative braces.in .c "^[ \t\n\r]*$") # choice with empty word new_ec_test(braces_empty_word1 braces.in a.d "^empty=word[ \t\n\r]*$") new_ec_test(braces_empty_word2 braces.in ab.d "^empty=word[ \t\n\r]*$") new_ec_test(braces_empty_word3 braces.in ac.d "^empty=word[ \t\n\r]*$") new_ec_test(braces_empty_word4 braces.in a,.d "^[ \t\n\r]*$") # choice with empty words new_ec_test(braces_empty_words1 braces.in a.e "^empty=words[ \t\n\r]*$") new_ec_test(braces_empty_words2 braces.in ab.e "^empty=words[ \t\n\r]*$") new_ec_test(braces_empty_words3 braces.in ac.e "^empty=words[ \t\n\r]*$") new_ec_test(braces_empty_words4 braces.in a,.e "^[ \t\n\r]*$") # no closing brace new_ec_test(braces_no_closing braces.in {.f "^closing=false[ \t\n\r]*$") new_ec_test(braces_no_closing_negative braces.in .f "^[ \t\n\r]*$") # nested braces new_ec_test(braces_nested1 braces.in word,this}.g "^[ \t\n\r]*$") new_ec_test(braces_nested2 braces.in {also,this}.g "^[ \t\n\r]*$") new_ec_test(braces_nested3 braces.in word.g "^nested=true[ \t\n\r]*$") new_ec_test(braces_nested4 braces.in {also}.g "^nested=true[ \t\n\r]*$") new_ec_test(braces_nested5 braces.in this.g "^nested=true[ \t\n\r]*$") # closing inside beginning new_ec_test(braces_closing_in_beginning braces.in {},b}.h "^closing=inside[ \t\n\r]*$") # missing closing braces new_ec_test(braces_unmatched1 braces.in {{,b,c{d}.i "^unmatched=true[ \t\n\r]*$") new_ec_test(braces_unmatched2 braces.in {.i "^[ \t\n\r]*$") new_ec_test(braces_unmatched3 braces.in b.i "^[ \t\n\r]*$") new_ec_test(braces_unmatched4 braces.in c{d.i "^[ \t\n\r]*$") new_ec_test(braces_unmatched5 braces.in .i "^[ \t\n\r]*$") # escaped comma new_ec_test(braces_escaped_comma1 braces.in a,b.txt "^comma=yes[ \t\n\r]*$") new_ec_test(braces_escaped_comma2 braces.in a.txt "^[ \t\n\r]*$") new_ec_test(braces_escaped_comma3 braces.in cd.txt "^comma=yes[ \t\n\r]*$") # escaped closing brace new_ec_test(braces_escaped_brace1 braces.in e.txt "^closing=yes[ \t\n\r]*$") new_ec_test(braces_escaped_brace2 braces.in }.txt "^closing=yes[ \t\n\r]*$") new_ec_test(braces_escaped_brace3 braces.in f.txt "^closing=yes[ \t\n\r]*$") # escaped backslash new_ec_test(braces_escaped_backslash1 braces.in g.txt "^backslash=yes[ \t\n\r]*$") if((NOT WIN32) AND (NOT CYGWIN)) # this case is impossible on Windows. new_ec_test(braces_escaped_backslash2 braces.in \\\\.txt "^backslash=yes[ \t\n\r]*$") endif() new_ec_test(braces_escaped_backslash3 braces.in i.txt "^backslash=yes[ \t\n\r]*$") # patterns nested in braces new_ec_test(braces_patterns_nested1 braces.in some.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested2 braces.in abe.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested3 braces.in abf.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested4 braces.in abg.j "^[ \t\n\r]*$") new_ec_test(braces_patterns_nested5 braces.in ace.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested6 braces.in acf.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested7 braces.in acg.j "^[ \t\n\r]*$") new_ec_test(braces_patterns_nested8 braces.in abce.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested9 braces.in abcf.j "^patterns=nested[ \t\n\r]*$") new_ec_test(braces_patterns_nested10 braces.in abcg.j "^[ \t\n\r]*$") new_ec_test(braces_patterns_nested11 braces.in ae.j "^[ \t\n\r]*$") new_ec_test(braces_patterns_nested12 braces.in .j "^[ \t\n\r]*$") # numeric brace range new_ec_test(braces_numeric_range1 braces.in 1 "^[ \t\n\r]*$") new_ec_test(braces_numeric_range2 braces.in 3 "^number=true[ \t\n\r]*$") new_ec_test(braces_numeric_range3 braces.in 15 "^number=true[ \t\n\r]*$") new_ec_test(braces_numeric_range4 braces.in 60 "^number=true[ \t\n\r]*$") new_ec_test(braces_numeric_range5 braces.in 5a "^[ \t\n\r]*$") new_ec_test(braces_numeric_range6 braces.in 120 "^number=true[ \t\n\r]*$") new_ec_test(braces_numeric_range7 braces.in 121 "^[ \t\n\r]*$") new_ec_test(braces_numeric_range8 braces.in 060 "^[ \t\n\r]*$") # alphabetical brace range: letters should not be considered for ranges new_ec_test(braces_alpha_range1 braces.in {aardvark..antelope} "^words=a[ \t\n\r]*$") new_ec_test(braces_alpha_range2 braces.in a "^[ \t\n\r]*$") new_ec_test(braces_alpha_range3 braces.in aardvark "^[ \t\n\r]*$") new_ec_test(braces_alpha_range4 braces.in agreement "^[ \t\n\r]*$") new_ec_test(braces_alpha_range5 braces.in antelope "^[ \t\n\r]*$") new_ec_test(braces_alpha_range6 braces.in antimatter "^[ \t\n\r]*$") # Tests for ** # test EditorConfig files with UTF-8 characters larger than 127 new_ec_test(utf_8_char utf8char.in "中文.txt" "^key=value[ \t\n\r]*$") # matches over path separator new_ec_test(star_star_over_separator1 star_star.in a/z.c "^key1=value1[ \t\n\r]*$") new_ec_test(star_star_over_separator2 star_star.in amnz.c "^key1=value1[ \t\n\r]*$") new_ec_test(star_star_over_separator3 star_star.in am/nz.c "^key1=value1[ \t\n\r]*$") new_ec_test(star_star_over_separator4 star_star.in a/mnz.c "^key1=value1[ \t\n\r]*$") new_ec_test(star_star_over_separator5 star_star.in amn/z.c "^key1=value1[ \t\n\r]*$") new_ec_test(star_star_over_separator6 star_star.in a/mn/z.c "^key1=value1[ \t\n\r]*$") new_ec_test(star_star_over_separator7 star_star.in b/z.c "^key2=value2[ \t\n\r]*$") new_ec_test(star_star_over_separator8 star_star.in b/mnz.c "^key2=value2[ \t\n\r]*$") new_ec_test(star_star_over_separator9 star_star.in b/mn/z.c "^key2=value2[ \t\n\r]*$") new_ec_test(star_star_over_separator10 star_star.in bmnz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator11 star_star.in bm/nz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator12 star_star.in bmn/z.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator13 star_star.in c/z.c "^key3=value3[ \t\n\r]*$") new_ec_test(star_star_over_separator14 star_star.in cmn/z.c "^key3=value3[ \t\n\r]*$") new_ec_test(star_star_over_separator15 star_star.in c/mn/z.c "^key3=value3[ \t\n\r]*$") new_ec_test(star_star_over_separator16 star_star.in cmnz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator17 star_star.in cm/nz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator18 star_star.in c/mnz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator19 star_star.in d/z.c "^key4=value4[ \t\n\r]*$") new_ec_test(star_star_over_separator20 star_star.in d/mn/z.c "^key4=value4[ \t\n\r]*$") new_ec_test(star_star_over_separator21 star_star.in dmnz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator22 star_star.in dm/nz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator23 star_star.in d/mnz.c "^[ \t\n\r]*$") new_ec_test(star_star_over_separator24 star_star.in dmn/z.c "^[ \t\n\r]*$") editorconfig-core-test-0.13/glob/braces.in000066400000000000000000000013601345553476600205500ustar00rootroot00000000000000; test { and } root=true ; word choice [*.{py,js,html}] choice=true ; single choice [{single}.b] choice=single ; empty choice [{}.c] empty=all ; choice with empty word [a{b,c,}.d] empty=word ; choice with empty words [a{,b,,c,}.e] empty=words ; no closing brace [{.f] closing=false ; nested braces [{word,{also},this}.g] nested=true ; closing inside beginning [{},b}.h] closing=inside ; opening inside beginning [{{,b,c{d}.i] unmatched=true ; escaped comma [{a\,b,cd}.txt] comma=yes ; escaped closing brace [{e,\},f}.txt] closing=yes ; escaped backslash [{g,\\,i}.txt] backslash=yes ; patterns nested in braces [{some,a{*c,b}[ef]}.j] patterns=nested ; numeric braces [{3..120}] number=true ; alphabetical [{aardvark..antelope}] words=a editorconfig-core-test-0.13/glob/brackets.in000066400000000000000000000012421345553476600211060ustar00rootroot00000000000000; test [ and ] root=true ; Character choice [[ab].a] choice=true ; Negative character choice [[!ab].b] choice=false ; Character range [[d-g].c] range=true ; Negative character range [[!d-g].d] range=false ; Range and choice [[abd-g].e] range_and_choice=true ; Choice with dash [[-ab].f] choice_with_dash=true ; Close bracket inside [[\]ab].g] close_inside=true ; Close bracket outside [[ab]].g] close_outside=true ; Negative close bracket inside [[!\]ab].g] close_inside=false ; Negative¬close bracket outside [[!ab]].g] close_outside=false ; Slash inside brackets [ab[e/]cd.i] slash_inside=true ; Slash after an half-open bracket [ab[/c] slash_half_open=true editorconfig-core-test-0.13/glob/question.in000066400000000000000000000000511345553476600211540ustar00rootroot00000000000000; test ? root=true [som?.c] key=value editorconfig-core-test-0.13/glob/star.in000066400000000000000000000001151345553476600202570ustar00rootroot00000000000000; test * root=true [a*e.c] key=value [Bar/*] keyb=valueb [*] keyc=valuec editorconfig-core-test-0.13/glob/star_star.in000066400000000000000000000001611345553476600213110ustar00rootroot00000000000000; test ** root=true [a**z.c] key1=value1 [b/**z.c] key2=value2 [c**/z.c] key3=value3 [d/**/z.c] key4=value4 editorconfig-core-test-0.13/glob/utf8char.in000066400000000000000000000001471345553476600210370ustar00rootroot00000000000000; test EditorConfig files with UTF-8 characters larger than 127 root = true [中文.txt] key = value editorconfig-core-test-0.13/meta/000077500000000000000000000000001345553476600167645ustar00rootroot00000000000000editorconfig-core-test-0.13/meta/CMakeLists.txt000077500000000000000000000041201345553476600215240ustar00rootroot00000000000000# tests/meta/CMakeLists.txt: Test of the test harness for editorconfig. # BSD-2-Clause # Copyright 2018 Christopher White (cxw42 at GitHub; http://devwrench.com) # 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.5) set(tests_meta_cmakelists_dir "${CMAKE_CURRENT_LIST_DIR}") # Line separator regex, for convenience set(L "[ \t\n\r]+") message(STATUS "meta: Using editorconfig ${EDITORCONFIG_CMD}") # Test run_and_sort() add_test(meta_runandsort cmake -P "${tests_meta_cmakelists_dir}/sample.cmake") set_tests_properties(meta_runandsort PROPERTIES PASS_REGULAR_EXPRESSION "^[\n]*0${L}a;b${L}b;c${L}b;e${L}b;f${L}c;b;a${L}d${L}$") # Have to permit leading \n's - I don't know how to get rid of them # Test the new multiline macro on a simple case new_ec_test_multiline(meta_multiline meta.in meta.c "^[\n]*answer=42${L}$") editorconfig-core-test-0.13/meta/meta.in000077500000000000000000000000231345553476600202400ustar00rootroot00000000000000[meta.c] answer=42 editorconfig-core-test-0.13/meta/sample.cmake000066400000000000000000000023171345553476600212520ustar00rootroot00000000000000# sample.cmake: Tests run_and_sort to make sure it's working. cmake_minimum_required(VERSION 3.5) # See documentation links at https://stackoverflow.com/q/12802377/2877364 set( tests_meta_sample_dir "${CMAKE_CURRENT_LIST_DIR}" ) list( APPEND CMAKE_MODULE_PATH "${tests_meta_sample_dir}/../cmake" ) include( runandsort ) run_and_sort( RETVAL lines RETVAL_FAILURE did_fail CAPTURE_STDERR TRIM_INITIAL_LEADING_SPACE # since we're using almostcat CMDLINE "cmake" "-DWHICH:STRING=${tests_meta_sample_dir}/sample.txt" "-P" "${tests_meta_sample_dir}/../cmake/almostcat.cmake" ) # Don't use cat(1) since we might be running on Windows if( ${did_fail} ) message( FATAL_ERROR "Program returned a nonzero exit code" ) return() endif() # message() will give us an extra \n, so trim one if we can. string( REGEX REPLACE "(\r\n|\r|\n)$" "" lines "${lines}" ) message( "${lines}" ) # This outputs to stderr, and prints nothing extra except for a \n at the end # Note that message( STATUS "${lines}" ) doesn't work because it outputs a "--" # before the actual content. # You could also use execute_process( COMMAND "echo" "${lines}" ) # or cmake -E echo, but I think the message() call is good enough. editorconfig-core-test-0.13/meta/sample.txt000077500000000000000000000000321345553476600210040ustar00rootroot00000000000000b;f b;c b;e a;b c;b;a d 0 editorconfig-core-test-0.13/parser/000077500000000000000000000000001345553476600173325ustar00rootroot00000000000000editorconfig-core-test-0.13/parser/CMakeLists.txt000066400000000000000000000153551345553476600221030ustar00rootroot00000000000000# # Copyright (c) 2011-2018 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # Basic parser tests # test repeat sections new_ec_test_multiline(repeat_sections_ML basic.in a.a "option1=value1[ \t]*[\n\r]+option2=value2[ \t\n\r]*") new_ec_test_multiline(basic_cascade_ML basic.in b.b "option1=c[ \t]*[\n\r]+option2=b[ \t\n\r]*") # Tests for whitespace parsing # test no whitespaces in property assignment new_ec_test(no_whitespace whitespace.in test1.c "^key=value[ \t\n\r]*$") # test single spaces around equals sign new_ec_test(single_spaces_around_equals whitespace.in test2.c "^key=value[ \t\n\r]*$") # test multiple spaces around equals sign new_ec_test(multiple_spaces_around_equals whitespace.in test3.c "^key=value[ \t\n\r]*$") # test spaces before property name new_ec_test(spaces_before_property_name whitespace.in test4.c "^key=value[ \t\n\r]*$") # test spaces before after property value new_ec_test(spaces_after_property_value whitespace.in test5.c "^key=value[ \t\n\r]*$") # test blank lines between properties new_ec_test_multiline(blank_lines_between_properties_ML whitespace.in test6.c "key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*") # test spaces in section name new_ec_test(spaces_in_section_name whitespace.in " test 7 " "^key=value[ \t\n\r]*$") # test spaces before section name are ignored new_ec_test(spaces_before_section_name whitespace.in test8.c "^key=value[ \t\n\r]*$") # test spaces after section name new_ec_test(spaces_after_section_name whitespace.in test9.c "^key=value[ \t\n\r]*$") # test spaces at beginning of line between properties new_ec_test_multiline(spaces_before_middle_property_ML whitespace.in test10.c "key1=value1[ \t]*[\n\r]+key2=value2[ \t]*[\n\r]+key3=value3[ \t\n\r]*") # test colon seperator with no whitespaces in property assignment new_ec_test(colon_sep_no_whitespace whitespace.in test1.d "^key=value[ \t\n\r]*$") # test colon seperator with single spaces around equals sign new_ec_test(colon_sep_single_spaces_around_equals whitespace.in test2.d "^key=value[ \t\n\r]*$") # test colon seperator with multiple spaces around equals sign new_ec_test(colon_sep_multiple_spaces_around_equals whitespace.in test3.d "^key=value[ \t\n\r]*$") # test colon seperator with spaces before property name new_ec_test(colon_sep_spaces_before_property_name whitespace.in test4.d "^key=value[ \t\n\r]*$") # test colon seperator with spaces before after property value new_ec_test(colon_sep_spaces_after_property_value whitespace.in test5.d "^key=value[ \t\n\r]*$") # Tests for comment parsing # test comments ignored after property name new_ec_test(comments_after_property comments.in test1.c "^key=value[ \t\n\r]*$") # test comments ignored after section name new_ec_test(comments_after_section comments.in test2.c "^key=value[ \t\n\r]*$") # test comments ignored before properties new_ec_test(comment_before_props comments.in test3.c "^key=value[ \t\n\r]*$") # test comments ignored between properties new_ec_test_multiline(comment_between_props_ML comments.in test4.c "key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*") # test semicolons at end of property value are included in value new_ec_test(semicolon_in_property comments.in test5.c "^key=value; not comment[ \t\n\r]*$") # test escaped semicolons are included in property value new_ec_test(escaped_semicolon_in_property comments.in test6.c "^key=value ; not comment[ \t\n\r]*$") # test escaped semicolons are included in section names new_ec_test(escaped_semicolon_in_section comments.in "test;.c" "^key=value[ \t\n\r]*$") # test octothorpe comments ignored after property name new_ec_test(octothorpe_comments_after_property comments.in test7.c "^key=value[ \t\n\r]*$") # test octothorpe comments ignored after section name new_ec_test(octothorpe_comments_after_section comments.in test8.c "^key=value[ \t\n\r]*$") # test octothorpe comments ignored before properties new_ec_test(octothorpe_comment_before_props comments.in test9.c "^key=value[ \t\n\r]*$") # test octothorpe comments ignored between properties new_ec_test_multiline(octothorpe_comment_between_props_ML comments.in test10.c "key1=value1[ \t]*[\n\r]+key2=value2[ \t\n\r]*") # test octothorpe at end of property value are included in value new_ec_test(octothorpe_in_property comments.in test11.c "^key=value# not comment[ \t\n\r]*$") # test escaped octothorpes are included in property value new_ec_test(escaped_octothorpe_in_property comments.in test12.c "^key=value # not comment[ \t\n\r]*$") # test escaped octothorpes are included in section names new_ec_test(escaped_octothorpe_in_section comments.in "test\#.c" "^key=value[ \t\n\r]*$") # test EditorConfig files with BOM at the head new_ec_test(bom_at_head bom.in "a.c" "^key=value[ \t\n\r]*$") # test EditorConfig files with CRLF line separators new_ec_test(crlf_linesep crlf.in "a.c" "^key=value[ \t\n\r]*$") # Test max property name and values new_ec_test(max_property_name limits.in test1 "^00000000000000000000000000000000000000000000000001=50[ \t\n\r]*$") new_ec_test(max_property_value limits.in test2 "^k255=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001[ \t\n\r]*$") # 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]*$") editorconfig-core-test-0.13/parser/basic.in000066400000000000000000000002011345553476600207340ustar00rootroot00000000000000[*.a] option1=value1 ; repeat section [*.a] option2=value2 [*.b] option1 = a option2 = a [b.b] option2 = b [*.b] option1 = c editorconfig-core-test-0.13/parser/bom.in000066400000000000000000000001041345553476600204320ustar00rootroot00000000000000; test EditorConfig files with BOM root = true [*] key = value editorconfig-core-test-0.13/parser/comments.in000066400000000000000000000016611345553476600215130ustar00rootroot00000000000000; test comments root = true [test1.c] key=value ; Comment after property is ignored [test2.c] ; Comment ignored, even with ] character key=value [test3.c] ; Comment before properties ignored key=value [test4.c] key1=value1 ; Comment between properties ignored key2=value2 ; Semicolon at end of value read as part of value [test5.c] key=value; not comment ; Escaped semicolon in value [test6.c] key=value \; not comment ; Escaped semicolon in section name [test\;.c] key=value [test7.c] key=value # Comment after property is ignored [test8.c] # Comment ignored, even with ] character key=value [test9.c] # Comment before properties ignored key=value [test10.c] key1=value1 # Comment between properties ignored key2=value2 # Octothorpe at end of value read as part of value [test11.c] key=value# not comment # Escaped octothorpe in value [test12.c] key=value \# not comment # Escaped octothorpe in section name [test\#.c] key=value editorconfig-core-test-0.13/parser/crlf.in000066400000000000000000000001301345553476600206020ustar00rootroot00000000000000; test EditorConfig files with CRLF line separators root = true [*] key = value editorconfig-core-test-0.13/parser/limits.in000066400000000000000000000212631345553476600211670ustar00rootroot00000000000000root = true [test1] 00000000000000000000000000000000000000000000000001=50 000000000000000000000000000000000000000000000000002=51 [test2] k255=000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 k256=0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002 [{test3,test0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003}] key=value [{test4,test00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004}] key=value editorconfig-core-test-0.13/parser/whitespace.in000066400000000000000000000016021345553476600220150ustar00rootroot00000000000000; test whitespace usage root = true ; no whitespace [test1.c] key=value ; spaces around equals [test2.c] key = value ; lots of space after equals [test3.c] key = value ; spaces before property name [test4.c] key=value ; spaces after property value [test5.c] key=value ; blank lines between properties [test6.c] key1=value1 key2=value2 ; spaces in section name [ test 7 ] key=value ; spaces before section name [test8.c] key=value ; spaces after section name [test9.c] key=value ; spacing before middle property [test10.c] key1=value1 key2=value2 key3=value3 ; colon separator with no spaces [test1.d] key:value ; colon separator with space after [test2.d] key: value ; colon separator with space before and after [test3.d] key : value ; colon separator with spaces before [test4.d] key:value ; colon seperator with spaces after property value [test5.d] key:value editorconfig-core-test-0.13/properties/000077500000000000000000000000001345553476600202325ustar00rootroot00000000000000editorconfig-core-test-0.13/properties/CMakeLists.txt000066400000000000000000000066751345553476600230100ustar00rootroot00000000000000# # Copyright (c) 2011-2018 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 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # test tab_width default new_ec_test_multiline(tab_width_default_ML tab_width_default.in test.c "indent_size=4[ \t]*[\n\r]+indent_style=space[ \t]*[\n\r]+tab_width=4[\t\n\r]*") # Tab_width should not be set to any value if indent_size is "tab" and # tab_width is not set new_ec_test_multiline(tab_width_default_indent_size_tab_ML tab_width_default.in test2.c "indent_size=tab[ \t]*[\n\r]+indent_style=tab[ \t\n\r]*") # Test indent_size default. When indent_style is "tab", indent_size defaults to # "tab". new_ec_test_multiline(indent_size_default_ML indent_size_default.in test.c "indent_size=tab[ \t]*[\n\r]+indent_style=tab[ \t\n\r]*") # Test indent_size default. When indent_style is "tab", indent_size should have # no default value for version prior than 0.9.0. new_ec_test_version(indent_size_default_pre_0_9_0 indent_size_default.in test.c "^indent_style=tab[ \t\n\r]*$" 0.8.0) # Test indent_size default. When indent_style is "space", indent_size has no # default value. new_ec_test(indent_size_default_space indent_size_default.in test2.c "^indent_style=space[ \t\n\r]*$") # Test indent_size default. When indent_style is "tab" and tab_width is set, # indent_size should default to tab_width new_ec_test_multiline(indent_size_default_with_tab_width_ML indent_size_default.in test3.c "indent_size=2[ \t]*[\n\r]+indent_style=tab[ \t]*[\n\r]+tab_width=2[ \t\n\r]*") # test that same property values are lowercased (v0.9.0 properties) new_ec_test_multiline(lowercase_values1_ML lowercase_values.in test1.c "end_of_line=crlf[ \t]*[\n\r]+indent_style=space[ \t\n\r]*") # test that same property values are lowercased (v0.9.0 properties) new_ec_test_multiline(lowercase_values2_ML lowercase_values.in test2.c "charset=utf-8[ \t]*[\n\r]+insert_final_newline=true[ \t]*[\n\r]+trim_trailing_whitespace=false[ \t\n\r]*$") # test that same property values are not lowercased new_ec_test(lowercase_values3 lowercase_values.in test3.c "^test_property=TestValue[ \t\n\r]*$") # test that all property names are lowercased new_ec_test(lowercase_names lowercase_names.in test.c "^testproperty=testvalue[ \t\n\r]*$") editorconfig-core-test-0.13/properties/indent_size_default.in000066400000000000000000000001651345553476600246030ustar00rootroot00000000000000root = true [test.c] indent_style = tab [test2.c] indent_style = space [test3.c] indent_style = tab tab_width = 2 editorconfig-core-test-0.13/properties/lowercase_names.in000066400000000000000000000001321345553476600237250ustar00rootroot00000000000000; test that property names are lowercased root = true [test.c] TestProperty = testvalue editorconfig-core-test-0.13/properties/lowercase_values.in000066400000000000000000000003361345553476600241270ustar00rootroot00000000000000; test property name lowercasing root = true [test1.c] indent_style = Space end_of_line = CRLF [test2.c] insert_final_newline = TRUE trim_trailing_whitespace = False charset = UTF-8 [test3.c] test_property = TestValue editorconfig-core-test-0.13/properties/tab_width_default.in000066400000000000000000000001531345553476600242320ustar00rootroot00000000000000root = true [test.c] indent_style = space indent_size = 4 [test2.c] indent_style = tab indent_size = tab