Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-27916] Test verifying use of GStrings in map keys
  • Loading branch information
abayer committed Aug 8, 2017
1 parent 37e3fdd commit 329f900
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -237,4 +237,21 @@ public void curriedClosuresInParallel() throws Exception {
jenkins.assertLogContains("[spam] spam", b);
jenkins.assertLogContains("[eggs] eggs", b);
}

@Issue("JENKINS-27916")
@Test
public void gStringInMapKey() throws Exception {
WorkflowJob job = jenkins.jenkins.createProject(WorkflowJob.class, "p");
job.setDefinition(new CpsFlowDefinition("def s1 = \"first-${env.BUILD_NUMBER}\"\n" +
"def s2 = \"second-${env.BUILD_NUMBER}\"\n" +
"def m = [(s1): 'first-key',\n" +
" \"${s2}\": 'second-key',\n" +
" \"third-${env.BUILD_NUMBER}\": 'third-key']\n" +
"m.each { k, v -> echo \"${k}:${v}\" }\n", true));

WorkflowRun b = jenkins.buildAndAssertSuccess(job);
jenkins.assertLogContains("first-1:first-key", b);
jenkins.assertLogContains("second-1:second-key", b);
jenkins.assertLogContains("third-1:third-key", b);
}
}

0 comments on commit 329f900

Please sign in to comment.