@@ -231,6 +231,54 @@ EOF".chomp;
231231 postGitHubHook(" dlang_dmd_open_6359.json" );
232232}
233233
234+ @(" pr-open-notify-bugzilla-whitehole" )
235+ unittest
236+ {
237+ setAPIExpectations(
238+ " /github/repos/dlang/dmd/pulls/6359/commits" ,
239+ (ref Json j){
240+ j[0 ][" commit" ][" message" ] = " Fix Issue 20540 - (White|Black)Hole does not work with return|scope functions" ;
241+ },
242+ " /github/repos/dlang/dmd/issues/6359/comments" ,
243+ " /bugzilla/buglist.cgi?bug_id=20540&ctype=csv&columnlist=short_desc,bug_status,resolution,bug_severity,priority,keywords" ,
244+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
245+ res.writeBody(
246+ ` bug_id,"short_desc","bug_status","resolution","bug_severity","priority","keywords"
247+ 20540,"(White|Black)Hole does not work with return|scope functions","NEW","---","normal","P1","pull"` );
248+ },
249+ " /github/orgs/dlang/public_members?per_page=100" ,
250+ " /github/repos/dlang/dmd/issues/6359/comments" ,
251+ (scope HTTPServerRequest req, scope HTTPServerResponse res) {
252+ assert (req.method == HTTPMethod.POST );
253+ assert (req.json[" body" ].get ! string .canFind(r " | \(White|Black\)Hole does not work with return|scope functions" ));
254+ },
255+ " /github/repos/dlang/dmd/issues/6359/labels" ,
256+ " /github/repos/dlang/dmd/issues/6359/labels" ,
257+ (scope HTTPServerRequest req, scope HTTPServerResponse res) {},
258+ " /trello/1/search?query=name:%22Issue%2020540%22&" ~ trelloAuth,
259+ (scope HTTPServerRequest req, scope HTTPServerResponse res) {
260+ res.writeBody(` {"cards": []}` );
261+ },
262+ " /bugzilla/jsonrpc.cgi" , // Bug.comments
263+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
264+ res.writeBody(` {"error" : null, "result" : {
265+ "bugs" : {"20540" : {"comments" : []}},
266+ "comments" : {}
267+ }}` );
268+ },
269+ " /bugzilla/jsonrpc.cgi" , // Bug.update
270+ (scope HTTPServerRequest req, scope HTTPServerResponse res){
271+ assert (req.method == HTTPMethod.POST );
272+ assert (req.json[" method" ].get ! string == " Bug.update" );
273+
274+ auto j = Json([" error" : Json(null ), " result" : Json.emptyObject]);
275+ res.writeJsonBody(j);
276+ },
277+ );
278+
279+ postGitHubHook(" dlang_dmd_open_6359.json" );
280+ }
281+
234282@(" pr-open-different-org" )
235283unittest
236284{
0 commit comments