| Conditions | 6 |
| Total Lines | 13 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package test |
||
| 12 | func assertHasOneViolation(code, message, path string) func(t *testing.T, err error) { |
||
| 13 | return func(t *testing.T, err error) { |
||
| 14 | t.Helper() |
||
| 15 | validationtest.AssertIsViolationList(t, err, func(t *testing.T, violations validation.ViolationList) bool { |
||
| 16 | t.Helper() |
||
| 17 | |||
| 18 | if assert.Len(t, violations, 1) { |
||
| 19 | return assert.Equal(t, code, violations[0].Code()) && |
||
| 20 | assert.Equal(t, message, violations[0].Message()) && |
||
| 21 | assert.Equal(t, path, violations[0].PropertyPath().String()) |
||
| 22 | } |
||
| 23 | |||
| 24 | return false |
||
| 25 | }) |
||
| 45 |