From 28caf01c8082dbed3a5ca87b070ffe5657514f01 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 12 Feb 2010 16:24:15 -0500 Subject: Moved test dir back out of markdown lib. We don't need to install the tests in everyones site-packages. We just need to distrubute them in the tarball for people to run before installing etc. --- tests/safe_mode/inline-html-advanced.html | 11 +++++ tests/safe_mode/inline-html-advanced.txt | 14 +++++++ tests/safe_mode/inline-html-comments.html | 8 ++++ tests/safe_mode/inline-html-comments.txt | 13 ++++++ tests/safe_mode/inline-html-simple.html | 45 ++++++++++++++++++++ tests/safe_mode/inline-html-simple.txt | 69 +++++++++++++++++++++++++++++++ tests/safe_mode/remove.html | 34 +++++++++++++++ tests/safe_mode/remove.txt | 69 +++++++++++++++++++++++++++++++ tests/safe_mode/replace.html | 34 +++++++++++++++ tests/safe_mode/replace.txt | 69 +++++++++++++++++++++++++++++++ tests/safe_mode/script_tags.html | 28 +++++++++++++ tests/safe_mode/script_tags.txt | 33 +++++++++++++++ tests/safe_mode/test.cfg | 8 ++++ tests/safe_mode/unsafe_urls.html | 20 +++++++++ tests/safe_mode/unsafe_urls.txt | 27 ++++++++++++ 15 files changed, 482 insertions(+) create mode 100644 tests/safe_mode/inline-html-advanced.html create mode 100644 tests/safe_mode/inline-html-advanced.txt create mode 100644 tests/safe_mode/inline-html-comments.html create mode 100644 tests/safe_mode/inline-html-comments.txt create mode 100644 tests/safe_mode/inline-html-simple.html create mode 100644 tests/safe_mode/inline-html-simple.txt create mode 100644 tests/safe_mode/remove.html create mode 100644 tests/safe_mode/remove.txt create mode 100644 tests/safe_mode/replace.html create mode 100644 tests/safe_mode/replace.txt create mode 100644 tests/safe_mode/script_tags.html create mode 100644 tests/safe_mode/script_tags.txt create mode 100644 tests/safe_mode/test.cfg create mode 100644 tests/safe_mode/unsafe_urls.html create mode 100644 tests/safe_mode/unsafe_urls.txt (limited to 'tests/safe_mode') diff --git a/tests/safe_mode/inline-html-advanced.html b/tests/safe_mode/inline-html-advanced.html new file mode 100644 index 0000000..e9dd2ec --- /dev/null +++ b/tests/safe_mode/inline-html-advanced.html @@ -0,0 +1,11 @@ +

Simple block on one line:

+

<div>foo</div>

+

And nested without indentation:

+

<div> +<div> +<div> +foo +</div> +</div> +<div>bar</div> +</div>

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-advanced.txt b/tests/safe_mode/inline-html-advanced.txt new file mode 100644 index 0000000..9d71ddc --- /dev/null +++ b/tests/safe_mode/inline-html-advanced.txt @@ -0,0 +1,14 @@ +Simple block on one line: + +
foo
+ +And nested without indentation: + +
+
+
+foo +
+
+
bar
+
diff --git a/tests/safe_mode/inline-html-comments.html b/tests/safe_mode/inline-html-comments.html new file mode 100644 index 0000000..0f1e417 --- /dev/null +++ b/tests/safe_mode/inline-html-comments.html @@ -0,0 +1,8 @@ +

Paragraph one.

+

<!-- This is a simple comment -->

+

<!-- + This is another comment. +-->

+

Paragraph two.

+

<!-- one comment block -- -- with two comments -->

+

The end.

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-comments.txt b/tests/safe_mode/inline-html-comments.txt new file mode 100644 index 0000000..41d830d --- /dev/null +++ b/tests/safe_mode/inline-html-comments.txt @@ -0,0 +1,13 @@ +Paragraph one. + + + + + +Paragraph two. + + + +The end. diff --git a/tests/safe_mode/inline-html-simple.html b/tests/safe_mode/inline-html-simple.html new file mode 100644 index 0000000..ad19a77 --- /dev/null +++ b/tests/safe_mode/inline-html-simple.html @@ -0,0 +1,45 @@ +

Here's a simple block:

+

<div> + foo +</div>

+

This should be a code block, though:

+
<div>
+    foo
+</div>
+
+

As should this:

+
<div>foo</div>
+
+

Now, nested:

+

<div> + <div> + <div> + foo + </div> + </div> +</div>

+

This should just be an HTML comment:

+

<!-- Comment -->

+

Multiline:

+

<!-- +Blah +Blah +-->

+

Code block:

+
<!-- Comment -->
+
+

Just plain comment, with trailing spaces on the line:

+

<!-- foo -->

+

Code:

+
<hr />
+
+

Hr's:

+

<hr>

+

<hr/>

+

<hr />

+

<hr>

+

<hr/>

+

<hr />

+

<hr class="foo" id="bar" />

+

<hr class="foo" id="bar"/>

+

<hr class="foo" id="bar" >

\ No newline at end of file diff --git a/tests/safe_mode/inline-html-simple.txt b/tests/safe_mode/inline-html-simple.txt new file mode 100644 index 0000000..14aa2dc --- /dev/null +++ b/tests/safe_mode/inline-html-simple.txt @@ -0,0 +1,69 @@ +Here's a simple block: + +
+ foo +
+ +This should be a code block, though: + +
+ foo +
+ +As should this: + +
foo
+ +Now, nested: + +
+
+
+ foo +
+
+
+ +This should just be an HTML comment: + + + +Multiline: + + + +Code block: + + + +Just plain comment, with trailing spaces on the line: + + + +Code: + +
+ +Hr's: + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ diff --git a/tests/safe_mode/remove.html b/tests/safe_mode/remove.html new file mode 100644 index 0000000..a1e1626 --- /dev/null +++ b/tests/safe_mode/remove.html @@ -0,0 +1,34 @@ +

Here's a simple block:

+

+

This should be a code block, though:

+
<div>
+    foo
+</div>
+
+

As should this:

+
<div>foo</div>
+
+

Now, nested:

+

+

This should just be an HTML comment:

+

+

Multiline:

+

+

Code block:

+
<!-- Comment -->
+
+

Just plain comment, with trailing spaces on the line:

+

+

Code:

+
<hr />
+
+

Hr's:

+

+

+

+

+

+

+

+

+

\ No newline at end of file diff --git a/tests/safe_mode/remove.txt b/tests/safe_mode/remove.txt new file mode 100644 index 0000000..14aa2dc --- /dev/null +++ b/tests/safe_mode/remove.txt @@ -0,0 +1,69 @@ +Here's a simple block: + +
+ foo +
+ +This should be a code block, though: + +
+ foo +
+ +As should this: + +
foo
+ +Now, nested: + +
+
+
+ foo +
+
+
+ +This should just be an HTML comment: + + + +Multiline: + + + +Code block: + + + +Just plain comment, with trailing spaces on the line: + + + +Code: + +
+ +Hr's: + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ diff --git a/tests/safe_mode/replace.html b/tests/safe_mode/replace.html new file mode 100644 index 0000000..fdf666e --- /dev/null +++ b/tests/safe_mode/replace.html @@ -0,0 +1,34 @@ +

Here's a simple block:

+

[HTML_REMOVED]

+

This should be a code block, though:

+
<div>
+    foo
+</div>
+
+

As should this:

+
<div>foo</div>
+
+

Now, nested:

+

[HTML_REMOVED]

+

This should just be an HTML comment:

+

[HTML_REMOVED]

+

Multiline:

+

[HTML_REMOVED]

+

Code block:

+
<!-- Comment -->
+
+

Just plain comment, with trailing spaces on the line:

+

[HTML_REMOVED]

+

Code:

+
<hr />
+
+

Hr's:

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

+

[HTML_REMOVED]

\ No newline at end of file diff --git a/tests/safe_mode/replace.txt b/tests/safe_mode/replace.txt new file mode 100644 index 0000000..14aa2dc --- /dev/null +++ b/tests/safe_mode/replace.txt @@ -0,0 +1,69 @@ +Here's a simple block: + +
+ foo +
+ +This should be a code block, though: + +
+ foo +
+ +As should this: + +
foo
+ +Now, nested: + +
+
+
+ foo +
+
+
+ +This should just be an HTML comment: + + + +Multiline: + + + +Code block: + + + +Just plain comment, with trailing spaces on the line: + + + +Code: + +
+ +Hr's: + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ diff --git a/tests/safe_mode/script_tags.html b/tests/safe_mode/script_tags.html new file mode 100644 index 0000000..df63ffc --- /dev/null +++ b/tests/safe_mode/script_tags.html @@ -0,0 +1,28 @@ +

This should be stripped/escaped in safe_mode.

+

<script> +alert("Hello world!") +</script>

+

With blank lines.

+

<script> + +alert("Hello world!") + +</script>

+

Now with some weirdness

+

<script <!-- +alert("Hello world!") +</script <> `

+

Try another way.

+

<script <!-- +alert("Hello world!") +</script <> + +This time with blank lines. + +<script <!-- + +alert("Hello world!") + +</script <> + +

\ No newline at end of file diff --git a/tests/safe_mode/script_tags.txt b/tests/safe_mode/script_tags.txt new file mode 100644 index 0000000..44041c2 --- /dev/null +++ b/tests/safe_mode/script_tags.txt @@ -0,0 +1,33 @@ +This should be stripped/escaped in safe_mode. + + + +With blank lines. + + + +Now with some weirdness + +`` + +This time with blank lines. + +