Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 186343 Details for
Bug 319977
wikitext-to-eclipse-help for Trac doesn't support images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch to add tests for Trac image macro support
0002-Add-tests-for-Trac-image-macro-support.patch (text/plain), 4.53 KB, created by
Mat Booth
on 2011-01-09 12:39:41 EST
(
hide
)
Description:
Patch to add tests for Trac image macro support
Filename:
MIME Type:
Creator:
Mat Booth
Created:
2011-01-09 12:39:41 EST
Size:
4.53 KB
patch
obsolete
>From 26300c30b195c9631f3abb44efe39f6a0e757b00 Mon Sep 17 00:00:00 2001 >From: mbooth <fedora@matbooth.co.uk> >Date: Sun, 9 Jan 2011 17:35:19 +0000 >Subject: [PATCH 2/2] Add tests for Trac image macro support. > >--- > .../tracwiki/core/TracWikiLanguageTest.java | 78 ++++++++++++++++++++ > 1 files changed, 78 insertions(+), 0 deletions(-) > >diff --git a/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/tracwiki/core/TracWikiLanguageTest.java b/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/tracwiki/core/TracWikiLanguageTest.java >index 3579352..fcc7477 100644 >--- a/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/tracwiki/core/TracWikiLanguageTest.java >+++ b/org.eclipse.mylyn.wikitext.tests/src/org/eclipse/mylyn/wikitext/tracwiki/core/TracWikiLanguageTest.java >@@ -39,6 +39,84 @@ public class TracWikiLanguageTest extends TestCase { > assertTrue(parser.getMarkupLanguage().isDetectingRawHyperlinks()); > } > >+ /** >+ * If a macro is not recognised, nothing should be substituted. >+ */ >+ public void testMacroNotRecognised() throws IOException { >+ String html = parser.parseToHtml("there is [[NoSuchMacro]] a macro [[NoSuchMacro()]] in the [[NoSuchMacro(params, go=here)]] page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile("<body><p>there is a macro in the page</p></body>").matcher(html).find()); >+ } >+ >+ /** >+ * If a we give the image macro an incorrect number of parameters, nothing should be substituted. >+ */ >+ public void testImageMacroIncorrectParams() throws IOException { >+ String html = parser.parseToHtml("there is a macro [[Image]] in the [[Image()]] page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile("<body><p>there is a macro in the page</p></body>").matcher(html).find()); >+ } >+ >+ /** >+ * Simplest possible use of the image macro. >+ */ >+ public void testImageMacroBasic() throws IOException { >+ String html = parser.parseToHtml("there is a macro [[Image(local_attachment.png)]] in the [[Image(http://www.example.com/external.png)]] page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile( >+ "<body><p>there is a macro <img border=\"0\" src=\"local_attachment.png\"/> in the <img border=\"0\" src=\"http://www.example.com/external.png\"/> page</p></body>") >+ .matcher(html) >+ .find()); >+ } >+ >+ /** >+ * Image macro with various options set. >+ */ >+ public void testImageMacroOptions() throws IOException { >+ String html = parser.parseToHtml("there is a macro [[Image(local_attachment.png, alt=Alt Text, title=Title Text, border=5)]] in the page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile( >+ "<body><p>there is a macro <img alt=\"Alt Text\" title=\"Title Text\" border=\"5\" src=\"local_attachment.png\"/> in the page</p></body>") >+ .matcher(html) >+ .find()); >+ } >+ >+ /** >+ * Image macro with implicitly set width and height. Width may be specified without the "width=". >+ */ >+ public void testImageMacroSizes() throws IOException { >+ String html = parser.parseToHtml("there is a macro [[Image(local_attachment.png, 100px, height=10%)]] in the page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile( >+ "<body><p>there is a macro <img height=\"10%\" width=\"100\" border=\"0\" src=\"local_attachment.png\"/> in the page</p></body>") >+ .matcher(html) >+ .find()); >+ } >+ >+ /** >+ * Image macro with floating alignment, may be specified with or without the preceding "align=". >+ */ >+ public void testImageMacroFloatAlign() throws IOException { >+ String html = parser.parseToHtml("there is a macro [[Image(local_attachment.png, right)]] in the [[Image(local_attachment.png, align=left)]] page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile( >+ "<body><p>there is a macro <img style=\"float:right;\" border=\"0\" src=\"local_attachment.png\"/> in the <img style=\"float:left;\" border=\"0\" src=\"local_attachment.png\"/> page</p></body>") >+ .matcher(html) >+ .find()); >+ } >+ >+ /** >+ * Image macro ignores incorrectly formatted or unrecognised options. >+ */ >+ public void testImageMacroInvalidOptions() throws IOException { >+ String html = parser.parseToHtml("there is a macro [[Image(local_attachment.png, beans, align=beans, border=b, width=10ee)]] in the page"); >+ TestUtil.println(html); >+ assertTrue(Pattern.compile( >+ "<body><p>there is a macro <img border=\"0\" src=\"local_attachment.png\"/> in the page</p></body>") >+ .matcher(html) >+ .find()); >+ } >+ > public void testParagraphs() throws IOException { > String html = parser.parseToHtml("first para\nnew line\n\nsecond para\n\n\n\n"); > TestUtil.println(html); >-- >1.7.3.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
greensopinion
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 319977
:
185605
|
186243
|
186342
| 186343 |
186403