(t *testing.T)
| 24 | ) |
| 25 | |
| 26 | func TestPluginConfigFromEngine_ToString(t *testing.T) { |
| 27 | in := PluginConfigFromEngine{ |
| 28 | Name: strings.Repeat("ab", 250), // 500 characters |
| 29 | RegistrationTimeout: 27 * time.Nanosecond, |
| 30 | Custom: FakeTestCustom(10), |
| 31 | } |
| 32 | out, err := in.ToString() |
| 33 | assert.NoError(t, err) |
| 34 | // This is coming from here: https://superuser.com/questions/1070272/why-does-windows-have-a-limit-on-environment-variables-at-all |
| 35 | // -> we verify that a plugin name of 500 characters is still within the limit |
| 36 | assert.LessOrEqual(t, len(out), 2048) |
| 37 | restored, err := NewPluginConfigFromEngineEnv(out) |
| 38 | assert.NoError(t, err) |
| 39 | assert.Equal(t, in, *restored) |
| 40 | } |
| 41 | |
| 42 | func TestNewPluginConfigFromEngineFromString(t *testing.T) { |
| 43 | t.Parallel() |
nothing calls this directly
no test coverage detected