editorconfig / editorconfig-vim

EditorConfig plugin for Vim
http://editorconfig.org
Other
3.13k stars 137 forks source link

Update core tests; check fnmatch for nested braces #160

Closed cxw42 closed 1 year ago

cxw42 commented 3 years ago

Re. https://github.com/editorconfig/editorconfig-core-py/pull/33

The Vimscript core is mostly a port of the Python core. The above-noted PR fixed a bug in the Python core that may also exist in the Vimscript core.

cxw42 commented 1 year ago

As of today, the nested-brace tests fail:

The following tests FAILED:
         55 - braces_nested_start1 (Failed)
         57 - braces_nested_start3 (Failed)
         58 - braces_nested_start4 (Failed)
         59 - braces_nested_start5 (Failed)
         60 - braces_nested_end1 (Failed)
         62 - braces_nested_end3 (Failed)
         63 - braces_nested_end4 (Failed)
         64 - braces_nested_end5 (Failed)

A single test:

$ EDITORCONFIG_DEBUG=`realpath foo.txt` /home/cxw/proj/editorconfig-vim/tests/core/editorconfig "-f" "braces.in" "/home/cxw/proj/editorconfig-vim/tests/core/tests/glob/a.k"

should match but doesn't. Debug file foo.txt says:

- fnmatch#fnmatchcase: regex    \v\/home\/cxw\/proj\/editorconfig\-vim\/tests\/core\/tests\/glob\_.*\/\{\{a\,b\}\,c\}\.k\_$

I don't think the regex should have escaped braces.

Edit Indeed, the problem and fix were the same as in the Python core.