From 2ea85bfe371215ef21fcd528bc40fa57c48ee698 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 31 Oct 2012 16:38:03 -0400
Subject: [PATCH] Personal repositories must always be owned by the account the repo is stored in
---
tests/com/gitblit/tests/MarkdownUtilsTest.java | 26 ++++++++++++++++++++++----
1 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/tests/com/gitblit/tests/MarkdownUtilsTest.java b/tests/com/gitblit/tests/MarkdownUtilsTest.java
index 2034bda..cd7ca02 100644
--- a/tests/com/gitblit/tests/MarkdownUtilsTest.java
+++ b/tests/com/gitblit/tests/MarkdownUtilsTest.java
@@ -15,17 +15,35 @@
*/
package com.gitblit.tests;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.text.ParseException;
-import junit.framework.TestCase;
+import org.junit.Test;
import com.gitblit.utils.MarkdownUtils;
-public class MarkdownUtilsTest extends TestCase {
+public class MarkdownUtilsTest {
+ @Test
public void testMarkdown() throws Exception {
- assertTrue(MarkdownUtils.transformMarkdown("# H1").equals("<h1> H1</h1>"));
- assertTrue(MarkdownUtils.transformMarkdown("## H2").equals("<h2> H2</h2>"));
+ assertEquals("<h1> H1</h1>", MarkdownUtils.transformMarkdown("# H1"));
+ assertEquals("<h2> H2</h2>", MarkdownUtils.transformMarkdown("## H2"));
+ assertEquals("<p><strong>THIS</strong> is a test</p>",
+ MarkdownUtils.transformMarkdown("**THIS** is a test"));
+ assertEquals("<p>** THIS ** is a test</p>",
+ MarkdownUtils.transformMarkdown("** THIS ** is a test"));
+ assertEquals("<p>**THIS ** is a test</p>",
+ MarkdownUtils.transformMarkdown("**THIS ** is a test"));
+ assertEquals("<p>** THIS** is a test</p>",
+ MarkdownUtils.transformMarkdown("** THIS** is a test"));
+
+ assertEquals("<table><tr><td>test</td></tr></table>",
+ MarkdownUtils.transformMarkdown("<table><tr><td>test</td></tr></table>"));
+ assertEquals("<table><tr><td><test></td></tr></table>",
+ MarkdownUtils.transformMarkdown("<table><tr><td><test></td></tr></table>"));
+
try {
MarkdownUtils.transformMarkdown((String) null);
assertTrue(false);
--
Gitblit v1.9.1