Skip to content
Permalink
Browse files

[JENKINS-27916] Test verifying use of GStrings in map keys

  • Loading branch information
abayer committed Aug 8, 2017
1 parent 37e3fdd commit 329f900d776c96f4f91576bb7bda3bbde31a26e1
Showing with 17 additions and 0 deletions.
  1. +17 −0 src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowDefinition2Test.java
@@ -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.
You can’t perform that action at this time.