From 397141d973b1b75af3c7d5d4516b7ab0f584a9cf Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sun, 24 Nov 2024 16:41:18 -0800 Subject: [PATCH] Test space in the middle of a key (#51) Fix #editorconfig/specification#39 --- parser/CMakeLists.txt | 5 ++++- parser/whitespace.in | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index a63e228..d89f4e9 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -1,5 +1,5 @@ # -# Copyright (c) 2011-2018 EditorConfig Team +# Copyright (c) 2011-2024 EditorConfig Team # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -74,6 +74,9 @@ new_ec_test_multiline(spaces_before_middle_property_ML whitespace.in test10.c 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 diff --git a/parser/whitespace.in b/parser/whitespace.in index e9586b2..6dd0d30 100644 --- a/parser/whitespace.in +++ b/parser/whitespace.in @@ -50,3 +50,7 @@ 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=value \ No newline at end of file