mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-15 21:12:15 +00:00
added code to handle macro expansion.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1166 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
8dd1446d3b
commit
d9184ad871
2 files changed
+55
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package hudson;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public class UtilTest extends TestCase {
|
||||
public void testReplaceMacro() {
|
||||
Map<String,String> m = new HashMap<String,String>();
|
||||
m.put("A","a");
|
||||
m.put("AA","aa");
|
||||
m.put("B","B");
|
||||
|
||||
// longest match
|
||||
assertEquals("aa",Util.replaceMacro("$AA",m));
|
||||
|
||||
// invalid keys are ignored
|
||||
assertEquals("$AAB",Util.replaceMacro("$AAB",m));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user