[HUDSON-5941] [HUDSON-5944] MarkupText.toString(boolean) was ignoring the

preEscape parameter when no markup tags were added.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@28737 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
mindless committed 2010-03-16 16:14:27 +00:00
1 parent eb6ddf8c90
commit f043975fc8
2 files changed
+10 -3

No files matched your search

@@ -1,7 +1,7 @@
/*
* The MIT License
*
* Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi
* Copyright (c) 2004-2010, Sun Microsystems, Inc., Kohsuke Kawaguchi
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -94,5 +94,12 @@ public class MarkupTextTest extends TestCase {
assertEquals("&amp;<foo>&amp;&nbsp;&amp;",text.toString(false));
}
public void testPreEscape() {
MarkupText text = new MarkupText("Line\n2 & 3\n<End>\n");
assertEquals("Line\n2 &amp; 3\n&lt;End>\n", text.toString(true));
text.addMarkup(4, "<hr/>");
assertEquals("Line<hr/>\n2 &amp; 3\n&lt;End>\n", text.toString(true));
}
private static final Pattern pattern = Pattern.compile("issue #([0-9]+)");
}