Tyler-Keith-Thompson / CucumberSwift

A lightweight swift Cucumber implementation
https://tyler-keith-thompson.github.io/CucumberSwift/documentation/cucumberswift/
MIT License
74 stars 19 forks source link

Non-Latin characters in test names #39

Closed alexvoss closed 2 years ago

alexvoss commented 2 years ago

Describe the bug Non-Latin characters in the test navigator come out mangled.

To Reproduce

  1. Write a feature file with non-Latin characters such as German umlaute in the text
  2. Implement step definitions
  3. Run tests
  4. Look at list of tests in Xcode's test navigator

Expected behavior Expected non-Latin characters to be preserved in the output. One of my steps is: --8<-- Dann wird eine Begrüßung auf angezeigt --8<-- (Then a welcome message is shown in )

Screenshots The generated name is "ThenWirdEineBegrUngAufEnglischAngezeigt". The two German characters 'ü' and 'ß' produce a single 'U'.

Additional context Add any other context about the problem here.

Tyler-Keith-Thompson commented 2 years ago

Thanks! I've used CFStringTokenizer to be smarter about splitting by word even allowing for emojis. This means class name generation should be locale aware and allow for any range of acceptable characters.