pax_global_header00006660000000000000000000000064147265031570014524gustar00rootroot0000000000000052 comment=d91029bdf1e3e0307714afe0d2cde7ba6fd208ab editorconfig-core-test-0.17.1/000077500000000000000000000000001472650315700161715ustar00rootroot00000000000000editorconfig-core-test-0.17.1/.editorconfig000066400000000000000000000002661472650315700206520ustar00rootroot00000000000000[{CMakeLists.txt,*.cmake}] 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.17.1/.gitignore000066400000000000000000000003131472650315700201560ustar00rootroot00000000000000# Generated by CMake CMakeCache.txt CMakeFiles Makefile cmake_install.cmake install_manifest.txt # Generated by CTest /Testing CTestTestfile.cmake # Eclipse .project # Editor backup files ~* *~ *.swp editorconfig-core-test-0.17.1/CMakeLists.txt000066400000000000000000000130221472650315700207270ustar00rootroot00000000000000# # 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. # # New escape-sequence processing. cmake_minimum_required(VERSION 3.16.3) cmake_policy(VERSION 3.16.3) # 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}) set(EDITORCONFIG_CMD "editorconfig" CACHE STRING "editorconfig command.") set(EDITORCONFIG_CMD_IS_TARGET OFF CACHE BOOL "EDITORCONFIG_CMD names a CMake target rather than an executable.") enable_testing() message(STATUS "tests: Standalone testing enabled") endif() if(${EDITORCONFIG_CMD_IS_TARGET}) message(STATUS "tests: Using editorconfig target ${EDITORCONFIG_CMD}") else() message(STATUS "tests: Using editorconfig binary ${EDITORCONFIG_CMD}") endif() # The most common test function function(new_ec_test name ec_file src_file regex) add_test(NAME ${name} COMMAND ${EDITORCONFIG_CMD} -f ${ec_file} "${CMAKE_CURRENT_SOURCE_DIR}/${src_file}") set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}") endfunction() # A test that requires a version specified function(new_ec_test_version name ec_file src_file regex version) add_test(NAME ${name} COMMAND ${EDITORCONFIG_CMD} -b ${version} -f ${ec_file} "${CMAKE_CURRENT_SOURCE_DIR}/${src_file}") set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${regex}") endfunction() # A test that requires the full path to the EditorConfig files function(new_ec_test_full_ec_file_path name ec_file src_file regex) add_test(NAME ${name} COMMAND ${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}") if(${EDITORCONFIG_CMD_IS_TARGET}) add_test(NAME ${name} COMMAND "cmake" "-D" "EDITORCONFIG_CMD=$" # Since variables aren't automatically 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") else() add_test(NAME ${name} COMMAND "cmake" "-D" "EDITORCONFIG_CMD=${EDITORCONFIG_CMD}" # Since variables aren't automatically 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") endif() set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "^[\r\n]*${regex}$") # Permit leading \n's because I can't always get rid of them using # only CMake-provided facilities. endfunction() # Tests for other CLI arguments. Usage: # new_ec_cli_test(NAME name MATCH pass_regex ARGS arguments...) function(new_ec_cli_test) # Parse args set(one_value_keywords NAME MATCH) set(multi_value_keywords ARGS) cmake_parse_arguments(P "" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN}) # Add test add_test(NAME ${P_NAME} COMMAND ${EDITORCONFIG_CMD} ${P_ARGS}) set_tests_properties(${name} PROPERTIES PASS_REGULAR_EXPRESSION "${P_MATCH}") 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.17.1/LICENSE.txt000066400000000000000000000024351472650315700200200ustar00rootroot00000000000000Copyright (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.17.1/README.md000066400000000000000000000023301472650315700174460ustar00rootroot00000000000000This 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.17.1/cli/000077500000000000000000000000001472650315700167405ustar00rootroot00000000000000editorconfig-core-test-0.17.1/cli/CMakeLists.txt000066400000000000000000000047361472650315700215120ustar00rootroot00000000000000# # 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 new_ec_cli_test(NAME test_long_version_switch ARGS --version MATCH "^EditorConfig.* Version [0-9]+\\.[0-9]+\\.[0-9]+(-[a-z]+)?[ \t\n\r]$") # test -v option returns version information new_ec_cli_test(NAME test_short_version_switch ARGS -v MATCH "^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. new_ec_cli_test(NAME multiple_files_on_command_line ARGS -f cli.in "${CMAKE_CURRENT_SOURCE_DIR}/file1.c" "${CMAKE_CURRENT_SOURCE_DIR}/file2.cpp" MATCH "^(\\[${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.17.1/cli/cli.in000066400000000000000000000000701472650315700200340ustar00rootroot00000000000000root = true [*.c] key1 = value1 [*.cpp] key2 = value2 editorconfig-core-test-0.17.1/cmake/000077500000000000000000000000001472650315700172515ustar00rootroot00000000000000editorconfig-core-test-0.17.1/cmake/almostcat.cmake000077500000000000000000000040011472650315700222400ustar00rootroot00000000000000# 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.16.3) 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.17.1/cmake/ec_sort.cmake000077500000000000000000000056021472650315700217170ustar00rootroot00000000000000# 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.16.3) # 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.17.1/cmake/runandsort.cmake000077500000000000000000000124321472650315700224570ustar00rootroot00000000000000# 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.16.3) # 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}") # DEBUG 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 retval =${ep_retval}=") # DEBUG #message(STATUS "Got stdout =${ep_stdout}=") # DEBUG #message(STATUS "Got stderr =${ep_stderr}=") # DEBUG # 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}=") # DEBUG # 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}=") # DEBUG # Turn the string into a list string(REPLACE "\n" ";" ep_out "${ep_out}") #message(STATUS "After listifying =${ep_out}=") # DEBUG # 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}=") # DEBUG # 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}=") # DEBUG # Out to the caller set(${P_RETVAL} "${ep_out}" PARENT_SCOPE) #message(STATUS "Returned =${ep_out}=") # DEBUG endfunction(run_and_sort) editorconfig-core-test-0.17.1/filetree/000077500000000000000000000000001472650315700177705ustar00rootroot00000000000000editorconfig-core-test-0.17.1/filetree/CMakeLists.txt000066400000000000000000000123001472650315700225240ustar00rootroot00000000000000# # 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 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.17.1/filetree/parent_directory.in000066400000000000000000000001671472650315700237010ustar00rootroot00000000000000root = 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.17.1/filetree/parent_directory/000077500000000000000000000000001472650315700233455ustar00rootroot00000000000000editorconfig-core-test-0.17.1/filetree/parent_directory/parent_directory.in000066400000000000000000000001771472650315700272570ustar00rootroot00000000000000[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.17.1/filetree/path_separator.in000066400000000000000000000002431472650315700233330ustar00rootroot00000000000000; 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.17.1/filetree/path_with_special_[chars/000077500000000000000000000000001472650315700247725ustar00rootroot00000000000000editorconfig-core-test-0.17.1/filetree/path_with_special_[chars/path_with_special_chars.in000066400000000000000000000000401472650315700321630ustar00rootroot00000000000000root = true [test.a] key=value editorconfig-core-test-0.17.1/filetree/root_file.in000066400000000000000000000000621472650315700223000ustar00rootroot00000000000000root = true [test.a] key=value [root] name=root editorconfig-core-test-0.17.1/filetree/root_file/000077500000000000000000000000001472650315700217525ustar00rootroot00000000000000editorconfig-core-test-0.17.1/filetree/root_file/root_file.in000066400000000000000000000000141472650315700242570ustar00rootroot00000000000000root = true editorconfig-core-test-0.17.1/filetree/root_mixed/000077500000000000000000000000001472650315700221415ustar00rootroot00000000000000editorconfig-core-test-0.17.1/filetree/root_mixed/root_file.in000066400000000000000000000000551472650315700244530ustar00rootroot00000000000000root = TrUe ignore = false [*.a] child=true editorconfig-core-test-0.17.1/filetree/unset.in000066400000000000000000000004441472650315700214600ustar00rootroot00000000000000root = 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.17.1/filetree/unset/000077500000000000000000000000001472650315700211265ustar00rootroot00000000000000editorconfig-core-test-0.17.1/filetree/unset/unset.in000066400000000000000000000004451472650315700226170ustar00rootroot00000000000000 [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.17.1/glob/000077500000000000000000000000001472650315700171145ustar00rootroot00000000000000editorconfig-core-test-0.17.1/glob/CMakeLists.txt000066400000000000000000000312341472650315700216570ustar00rootroot00000000000000# # 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]*$") # Slash makes the pattern not match in subdirectories new_ec_test_multiline(star_after_slash_ML_in_subdir star.in bat/Bar/foo.txt "^[ \t\n\r]*keyc=valuec[ \t\n\r]*$") # Slash makes the pattern not match dotfiles in subdirectories new_ec_test_multiline(star_matches_dot_file_after_slash_ML_in_subdir star.in bat/Bar/.editorconfig "^[ \t\n\r]*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]*$") # does not match slash new_ec_test(question_slash question.in som/.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]*$") # nested braces, adjacent at start new_ec_test(braces_nested_start1 braces.in {{a,b},c}.k "^[ \t\n\r]*$") new_ec_test(braces_nested_start2 braces.in {a,b}.k "^[ \t\n\r]*$") new_ec_test(braces_nested_start3 braces.in a.k "^nested_start=true[ \t\n\r]*$") new_ec_test(braces_nested_start4 braces.in b.k "^nested_start=true[ \t\n\r]*$") new_ec_test(braces_nested_start5 braces.in c.k "^nested_start=true[ \t\n\r]*$") # nested braces, adjacent at end new_ec_test(braces_nested_end1 braces.in {a,{b,c}}.l "^[ \t\n\r]*$") new_ec_test(braces_nested_end2 braces.in {b,c}.l "^[ \t\n\r]*$") new_ec_test(braces_nested_end3 braces.in a.l "^nested_end=true[ \t\n\r]*$") new_ec_test(braces_nested_end4 braces.in b.l "^nested_end=true[ \t\n\r]*$") new_ec_test(braces_nested_end5 braces.in c.l "^nested_end=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.17.1/glob/braces.in000066400000000000000000000015641472650315700207110ustar00rootroot00000000000000; 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 ; nested braces, adjacent at start [{{a,b},c}.k] nested_start=true ; nested braces, adjacent at end [{a,{b,c}}.l] nested_end=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.17.1/glob/brackets.in000066400000000000000000000012421472650315700212410ustar00rootroot00000000000000; 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.17.1/glob/question.in000066400000000000000000000000511472650315700213070ustar00rootroot00000000000000; test ? root=true [som?.c] key=value editorconfig-core-test-0.17.1/glob/star.in000066400000000000000000000001151472650315700204120ustar00rootroot00000000000000; test * root=true [a*e.c] key=value [Bar/*] keyb=valueb [*] keyc=valuec editorconfig-core-test-0.17.1/glob/star_star.in000066400000000000000000000001611472650315700214440ustar00rootroot00000000000000; 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.17.1/glob/utf8char.in000066400000000000000000000001471472650315700211720ustar00rootroot00000000000000; test EditorConfig files with UTF-8 characters larger than 127 root = true [中文.txt] key = value editorconfig-core-test-0.17.1/meta/000077500000000000000000000000001472650315700171175ustar00rootroot00000000000000editorconfig-core-test-0.17.1/meta/CMakeLists.txt000077500000000000000000000042331472650315700216640ustar00rootroot00000000000000# 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. 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 "^[\r\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. The new_ec_test_multiline # function adds /^[\r\n]*/ to the beginning of the provided regex, and # /$/ to the end. new_ec_test_multiline(meta_multiline meta.in meta.c "answer=42${L}") editorconfig-core-test-0.17.1/meta/meta.in000077500000000000000000000000231472650315700203730ustar00rootroot00000000000000[meta.c] answer=42 editorconfig-core-test-0.17.1/meta/sample.cmake000066400000000000000000000023171472650315700214050ustar00rootroot00000000000000# 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.17.1/meta/sample.txt000077500000000000000000000000321472650315700211370ustar00rootroot00000000000000b;f b;c b;e a;b c;b;a d 0 editorconfig-core-test-0.17.1/parser/000077500000000000000000000000001472650315700174655ustar00rootroot00000000000000editorconfig-core-test-0.17.1/parser/CMakeLists.txt000066400000000000000000000255761472650315700222440ustar00rootroot00000000000000# # Copyright (c) 2011-2024 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]*") # value with whitespace inside and the leading and trailing ws ignored new_ec_test(value_with_whitespace_inside whitespace.in test11.c "^key=value with whitespace inside[\n\r]+$") # test spaces in the middle of a key new_ec_test(spaces_in_middle_key whitespace.in test12.c "ke y=value[ \t\n\r]*") # Tests for comment parsing # 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 and hashes at end of property value are included in value new_ec_test(semicolon_or_hash_in_property comments.in test5.c "^key1=value; not comment[\n\r]+key2=value # not comment[ \t\n\r]*$") # test that backslashes before semicolons and hashes in property values # are included in value. # NOTE: [\\] matches a single literal backslash. new_ec_test(backslashed_semicolon_or_hash_in_property comments.in test6.c "^key1=value [\\]; not comment[\n\r]+key2=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 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_value comments.in test11.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 minimum supported lengths of section name, key and value new_ec_test(min_supported_key_length limits.in test1 "^aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa[ \t\n\r]*$") new_ec_test(min_supported_section_name_length limits.in test3 "^k1024=v1024[ \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]*$") # A value set to empty string new_ec_test(key_set_to_empty_string empty_values.in test1 "^key1=[\n\r]+key2=[\n\r]+key3=[\n\r]+$") editorconfig-core-test-0.17.1/parser/basic.in000066400000000000000000000002011472650315700210670ustar00rootroot00000000000000[*.a] option1=value1 ; repeat section [*.a] option2=value2 [*.b] option1 = a option2 = a [b.b] option2 = b [*.b] option1 = c editorconfig-core-test-0.17.1/parser/bom.in000066400000000000000000000001041472650315700205650ustar00rootroot00000000000000; test EditorConfig files with BOM root = true [*] key = value editorconfig-core-test-0.17.1/parser/comments.in000066400000000000000000000014371472650315700216470ustar00rootroot00000000000000; test comments root = true [test3.c] ; Comment before properties ignored key=value [test4.c] key1=value1 ; Comment between properties ignored key2=value2 ; Semicolon or hash at end of value read as part of value [test5.c] key1=value; not comment key2=value # not comment ; Backslash before a semicolon or hash is part of the value [test6.c] key1=value \; not comment key2=value \# not comment ; Escaped semicolon in section name [test\;.c] 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.17.1/parser/comments_and_newlines.in000066400000000000000000000000451472650315700243670ustar00rootroot00000000000000 # Just comments # ... and newlines editorconfig-core-test-0.17.1/parser/comments_only.in000066400000000000000000000000361472650315700227020ustar00rootroot00000000000000# Just a comment, nothing elseeditorconfig-core-test-0.17.1/parser/crlf.in000066400000000000000000000001301472650315700207350ustar00rootroot00000000000000; test EditorConfig files with CRLF line separators root = true [*] key = value editorconfig-core-test-0.17.1/parser/empty.in000066400000000000000000000000001472650315700211410ustar00rootroot00000000000000editorconfig-core-test-0.17.1/parser/empty_values.in000066400000000000000000000002301472650315700225250ustar00rootroot00000000000000root = true [test1] ; A value set to empty string key1= ; Whitespace after equals sign is ignored key2= ; A file final key set to empty string key3= editorconfig-core-test-0.17.1/parser/limits.in000066400000000000000000000143651472650315700213270ustar00rootroot00000000000000root = true ; minimum supported key length of 1024 characters [test1] aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaa}] k1024=v1024 editorconfig-core-test-0.17.1/parser/newlines_only.in000066400000000000000000000000021472650315700226720ustar00rootroot00000000000000 editorconfig-core-test-0.17.1/parser/whitespace.in000066400000000000000000000013641472650315700221550ustar00rootroot00000000000000; 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 ; value with whitespace inside and the leading and trailing ws ignored [test11.c] key= value with whitespace inside ; space in the middle of a key [test12.c] ke y=valueeditorconfig-core-test-0.17.1/properties/000077500000000000000000000000001472650315700203655ustar00rootroot00000000000000editorconfig-core-test-0.17.1/properties/CMakeLists.txt000066400000000000000000000066751472650315700231430ustar00rootroot00000000000000# # 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.17.1/properties/indent_size_default.in000066400000000000000000000001651472650315700247360ustar00rootroot00000000000000root = true [test.c] indent_style = tab [test2.c] indent_style = space [test3.c] indent_style = tab tab_width = 2 editorconfig-core-test-0.17.1/properties/lowercase_names.in000066400000000000000000000001321472650315700240600ustar00rootroot00000000000000; test that property names are lowercased root = true [test.c] TestProperty = testvalue editorconfig-core-test-0.17.1/properties/lowercase_values.in000066400000000000000000000003361472650315700242620ustar00rootroot00000000000000; 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.17.1/properties/tab_width_default.in000066400000000000000000000001531472650315700243650ustar00rootroot00000000000000root = true [test.c] indent_style = space indent_size = 4 [test2.c] indent_style = tab indent_size = tab