x/mode: more tests and a quick note
This commit is contained in:
parent
98dbc1202a
commit
be7fe0d6d8
@ -477,6 +477,10 @@ func Parts(s string) iter.Seq2[NamePart, string] {
|
||||
state, j := PartDigest, len(s)
|
||||
for i := len(s) - 1; i >= 0; i-- {
|
||||
if partLen++; partLen > MaxNamePartLen {
|
||||
// catch a part that is too long early, so
|
||||
// we don't keep spinning on it, waiting for
|
||||
// an isInValidPart check which would scan
|
||||
// over it again.
|
||||
yield(PartInvalid, "")
|
||||
return
|
||||
}
|
||||
|
@ -60,6 +60,8 @@ var testNames = map[string]fields{
|
||||
"x@sha123-1": {model: "x", digest: "sha123-1"},
|
||||
"@sha456-2": {digest: "sha456-2"},
|
||||
|
||||
"@@sha123-1": {},
|
||||
|
||||
// preserves case for build
|
||||
"x+b": {model: "x", build: "b"},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user