(t *testing.T)
| 81 | } |
| 82 | |
| 83 | func TestAtomicLevelMutation(t *testing.T) { |
| 84 | lvl := NewAtomicLevel() |
| 85 | lvl.SetLevel(WarnLevel) |
| 86 | // Trigger races for non-atomic level mutations. |
| 87 | proceed := make(chan struct{}) |
| 88 | wg := &sync.WaitGroup{} |
| 89 | runConcurrently(10, 100, wg, func() { |
| 90 | <-proceed |
| 91 | assert.Equal(t, WarnLevel, lvl.Level()) |
| 92 | }) |
| 93 | runConcurrently(10, 100, wg, func() { |
| 94 | <-proceed |
| 95 | lvl.SetLevel(WarnLevel) |
| 96 | }) |
| 97 | close(proceed) |
| 98 | wg.Wait() |
| 99 | } |
| 100 | |
| 101 | func TestAtomicLevelText(t *testing.T) { |
| 102 | tests := []struct { |
nothing calls this directly
no test coverage detected