(t *testing.T, log string, messages []string)
| 138 | } |
| 139 | |
| 140 | func checkContainerLog(t *testing.T, log string, messages []string) { |
| 141 | lines := strings.Split(strings.TrimSpace(log), "\n") |
| 142 | require.Len(t, lines, len(messages), "log line number should match") |
| 143 | for i, line := range lines { |
| 144 | ts, msg, ok := strings.Cut(line, " ") |
| 145 | require.True(t, ok) |
| 146 | _, err := time.Parse(time.RFC3339Nano, ts) |
| 147 | assert.NoError(t, err, "timestamp should be in RFC3339Nano format") |
| 148 | assert.Equal(t, messages[i], msg, "log content should match") |
| 149 | } |
| 150 | } |
no test coverage detected
searching dependent graphs…