Skip to content

Commit 058ec8a

Browse files
committed
Sort the errors returned by parseConfig
1 parent 73a1655 commit 058ec8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/AppBundle/config/parseConfig.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func parseCommandOrCommands(_ raw: TOMLValueConvertible) -> Parsed<[any Command]
175175

176176
@MainActor func parseConfig(_ rawToml: String) -> (config: Config, errors: [String]) { // todo change return value to Result
177177
let result = _parseConfig(rawToml)
178-
return (result.config, result.errors.map(\.description))
178+
return (result.config, result.errors.map(\.description).sorted())
179179
}
180180

181181
@MainActor private func _parseConfig(_ rawToml: String) -> (config: Config, errors: [ConfigParseError]) { // todo change return value to Result

Sources/AppBundleTests/config/ConfigTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ final class ConfigTest: XCTestCase {
428428
""",
429429
)
430430
assertEquals(errors1, [
431-
"key-mapping.key-notation-to-key-code: ' f' is invalid key notation",
432431
"key-mapping.key-notation-to-key-code.q: 'qw' is invalid key code",
432+
"key-mapping.key-notation-to-key-code: ' f' is invalid key notation",
433433
])
434434

435435
let (dvorakConfig, dvorakErrors) = parseConfig(

0 commit comments

Comments
 (0)