My app processes numbers, and depends on the grouping separator on the system locale (Locale.current).
The user can set a completely custom symbol as their number separator in the macOS System Preferences.
In my tests, I need to verify that custom grouping separators on Locale objects work correctly. But I can't set a custom grouping separator as the groupingSeparator property on Locale is read-only:
How do I create a Locale object for testing purposes, that will simulate a custom locale the user might have configured in the System Preferences?
The user can set a completely custom symbol as their number separator in the macOS System Preferences.
In my tests, I need to verify that custom grouping separators on Locale objects work correctly. But I can't set a custom grouping separator as the groupingSeparator property on Locale is read-only:
Code Block /// For example, for "en_US", returns ",". public var groupingSeparator: String? { get }
How do I create a Locale object for testing purposes, that will simulate a custom locale the user might have configured in the System Preferences?