From a190c3941a7bed4274fe08e92ba4ce368c1c837f Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 19 Mar 2008 03:47:16 +0000 Subject: Added safe_mode to testing framework and soem tests. --- tests/safe_mode/inline-html-advanced.html | 14 +++++++ tests/safe_mode/inline-html-advanced.txt | 14 +++++++ tests/safe_mode/inline-html-comments.html | 14 +++++++ tests/safe_mode/inline-html-comments.txt | 13 ++++++ tests/safe_mode/inline-html-simple.html | 64 ++++++++++++++++++++++++++++ tests/safe_mode/inline-html-simple.txt | 69 +++++++++++++++++++++++++++++++ tests/safe_mode/script_tags.html | 33 +++++++++++++++ tests/safe_mode/script_tags.txt | 33 +++++++++++++++ 8 files changed, 254 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/script_tags.html create mode 100644 tests/safe_mode/script_tags.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..bc59ab1 --- /dev/null +++ b/tests/safe_mode/inline-html-advanced.html @@ -0,0 +1,14 @@ +

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..8deccba --- /dev/null +++ b/tests/safe_mode/inline-html-comments.html @@ -0,0 +1,14 @@ +

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..24d16ba --- /dev/null +++ b/tests/safe_mode/inline-html-simple.html @@ -0,0 +1,64 @@ +

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/script_tags.html b/tests/safe_mode/script_tags.html new file mode 100644 index 0000000..cb2abfa --- /dev/null +++ b/tests/safe_mode/script_tags.html @@ -0,0 +1,33 @@ +

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..55c60e9 --- /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. + +