(t *testing.T, test booleanOptionTest, optionName string)
| 28 | } |
| 29 | |
| 30 | func testBooleanOption(t *testing.T, test booleanOptionTest, optionName string) { |
| 31 | t.Helper() |
| 32 | |
| 33 | t.Run("enables "+optionName, func(t *testing.T) { |
| 34 | agent, err := NewAgentWithOptions(test.optionFunc()) |
| 35 | assert.NoError(t, err) |
| 36 | defer agent.Close() //nolint:errcheck |
| 37 | |
| 38 | assert.True(t, test.getValue(agent)) |
| 39 | }) |
| 40 | |
| 41 | t.Run("default is false", func(t *testing.T) { |
| 42 | agent, err := NewAgentWithOptions() |
| 43 | assert.NoError(t, err) |
| 44 | defer agent.Close() //nolint:errcheck |
| 45 | |
| 46 | assert.False(t, test.getValue(agent)) |
| 47 | }) |
| 48 | |
| 49 | t.Run("works with config", func(t *testing.T) { |
| 50 | config := &AgentConfig{ |
| 51 | NetworkTypes: []NetworkType{NetworkTypeUDP4}, |
| 52 | } |
| 53 | test.configSetter(config, true) |
| 54 | |
| 55 | agent, err := NewAgent(config) |
| 56 | assert.NoError(t, err) |
| 57 | defer agent.Close() //nolint:errcheck |
| 58 | |
| 59 | assert.True(t, test.getValue(agent)) |
| 60 | }) |
| 61 | } |
| 62 | |
| 63 | func TestDefaultNominationValueGenerator(t *testing.T) { |
| 64 | t.Run("generates incrementing values", func(t *testing.T) { |
no test coverage detected
searching dependent graphs…