Unit tests for APK version parsing & fix typo in parser

This commit is contained in:
2025-07-05 22:29:55 +10:00
parent d88b96df80
commit 53c68cdfc7
3 changed files with 58 additions and 4 deletions

View File

@ -16,7 +16,7 @@ internal struct ApkVersionReader {
mutating func next() throws(Invalid) -> TokenPart {
self.seen.formUnion(self.last)
switch string.first ?? UInt8(ascii: "0") {
switch string.first ?? UInt8(ascii: "\0") {
case UInt8(ascii: "a")...UInt8(ascii: "z"): // Letter suffix
guard self.seen.contains(.initial),
self.last.isDisjoint(with: [ .letter, .suffix, .suffixNumber, .commitHash, .revision ]) else {