MCPcopy Index your code
hub / github.com/coredns/coredns / TestSetup

Function TestSetup

plugin/https3/setup_test.go:12–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestSetup(t *testing.T) {
13 tests := []struct {
14 input string
15 shouldErr bool
16 expectedErrContent string
17 expectedMaxStreams *int
18 }{
19 // Valid configurations
20 {
21 input: `https3`,
22 shouldErr: false,
23 },
24 {
25 input: `https3 {
26 }`,
27 shouldErr: false,
28 },
29 {
30 input: `https3 {
31 max_streams 100
32 }`,
33 shouldErr: false,
34 expectedMaxStreams: intPtr(100),
35 },
36 // Zero values (unbounded)
37 {
38 input: `https3 {
39 max_streams 0
40 }`,
41 shouldErr: false,
42 expectedMaxStreams: intPtr(0),
43 },
44 // Error cases
45 {
46 input: `https3 {
47 max_streams
48 }`,
49 shouldErr: true,
50 expectedErrContent: "Wrong argument count",
51 },
52 {
53 input: `https3 {
54 max_streams abc
55 }`,
56 shouldErr: true,
57 expectedErrContent: "invalid max_streams value",
58 },
59 {
60 input: `https3 {
61 max_streams -1
62 }`,
63 shouldErr: true,
64 expectedErrContent: "must be a non-negative integer",
65 },
66 {
67 input: `https3 {
68 max_streams 100
69 max_streams 200

Callers

nothing calls this directly

Calls 6

GetConfigFunction · 0.92
intPtrFunction · 0.70
setupFunction · 0.70
assertIntPtrValueFunction · 0.70
ErrorfMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…