Atlas › Test

test#05

Exact test identity: go.temporal.io/server/common/priorities/TestValidate/test#05

Package
go.temporal.io/server/common/priorities
Suite / test hierarchy
TestValidate/test#05
Test
test#05
Introduced at
priority_util.go ×1 Frontier kind: Joint frontier
Covered ranges
7
Covered lines
9
Covered files
1

Co-introduced tests

4 other tests enter at the same concept.

Covered source

Expand a file to inspect source; the > gutter marks covered lines.

go.temporal.io/server/common/priorities/priority_util.go 9 covered LOC · 7 ranges

Open complete file

35 }
36
37 > func ValidateFairnessKey(key string) error { priority_util.go
38 > if len(key) > fairnessKeyMaxLength {
39 return ErrFairnessKeyLength
40 }
41 > return nil priority_util.go
42 }
43
49 }
50
51 > func Validate(p *commonpb.Priority) error { priority_util.go
52 > if p == nil {
53 return nil
54 > } else if p.PriorityKey < 0 { priority_util.go
55 return ErrInvalidPriority
56 > } else if err := ValidateFairnessKey(p.FairnessKey); err != nil { priority_util.go
57 return err
58 > } else if p.FairnessWeight < 0 { priority_util.go
59 return ErrInvalidFairnessWeight
60 }
61 > return nil priority_util.go
62 }