Unit tests for APK version parsing & fix typo in parser

This commit is contained in:
a_dinosaur committed 2025-07-05 22:29:55 +10:00
1 parent d88b96df80
commit 53c68cdfc7
3 files changed
+58 -4

No files matched your search

+1 -1
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 {