add method tests for pattern collision
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Adrien Marquès 2020-03-21 15:52:07 +01:00
parent 9c3166397f
commit 3017cc5ba9
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 30 additions and 0 deletions

View File

@ -739,6 +739,36 @@ func TestServiceCollision(t *testing.T) {
]`,
ErrPatternCollision,
},
{
`[
{ "method": "GET", "path": "/a/{b}",
"info": "info", "in": {
"{b}": { "info":"info", "type": "uint" }
}
},
{ "method": "GET", "path": "/a/{c}",
"info": "info", "in": {
"{c}": { "info":"info", "type": "uint" }
}
}
]`,
ErrPatternCollision,
},
{
`[
{ "method": "GET", "path": "/a/{b}",
"info": "info", "in": {
"{b}": { "info":"info", "type": "uint" }
}
},
{ "method": "PUT", "path": "/a/{c}",
"info": "info", "in": {
"{c}": { "info":"info", "type": "uint" }
}
}
]`,
nil, // different methods
},
}
for i, test := range tests {