Closed kieran-ryan closed 4 months ago
Just noticed the Java implementation doesn't test against the testdata
set. Still it would be good to add an example there, so if/when we do add tests for that, it will be covered.
My present understanding is that testdata only validates that: parsing - before and after formatting - yields the same messages representation - excluding the formatting itself. To check: modify the formatting of a testdata feature file, and run npm run test
inside the javascript
directory; it should pass.
Thus, surplus to existing feature files, adding my example would only really test that CJK characters can be parsed and are not removed by formatting; not the formatting itself - not sure whether that is valuable?
The fix is trivial: adding assert.strictEqual(gherkinSource, formattedGherkinSource)
- which fails for every feature file as they are unformatted - and of course to reformat the testdata feature files. Though unsure is that best course of action?
Interested to get your perspective on best way forward - and whether should be completed as separate issue:
.ndjson
and .tokens
representations are required or can be removed.Okay that's more complicated than expected. I was expecting this project to be in a better state then it is.
Let's offload those concerns to https://github.com/cucumber/gherkin-utils/issues/59 and https://github.com/cucumber/gherkin-utils/issues/62.
Feel free to merge and release this.
🤔 What's changed?
Count full-width characters as 2 spaces to determine table column width for formatting; with half-width characters counted as 1 space, as per existing implementation.
Implementation aligns with vscode-markdown and Cucumber Autocomplete extension.
⚡️ What's your motivation?
Fixes cucumber/vscode#99.
Present formatted example:
Amended formatted example
Formatted example using a full-width character supported font
With the aforementioned 'amended formatted example' and the Iosevka font, it appears as follows in the browser...
...and as follows in VSCode:
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Whether should be classed as a 'bug' or an 'enhancement'.
📋 Checklist: