aboutsummaryrefslogtreecommitdiffstats
path: root/test/webrick/test_htmlutils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/webrick/test_htmlutils.rb')
-rw-r--r--test/webrick/test_htmlutils.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/webrick/test_htmlutils.rb b/test/webrick/test_htmlutils.rb
new file mode 100644
index 0000000000..987bc229c9
--- /dev/null
+++ b/test/webrick/test_htmlutils.rb
@@ -0,0 +1,16 @@
+require "test/unit"
+require "webrick/htmlutils"
+
+class TestWEBrickHTMLUtils < Test::Unit::TestCase
+ include WEBrick::HTMLUtils
+
+ def test_escape
+ assert_equal("foo", escape("foo"))
+ assert_equal("foo bar", escape("foo bar"))
+ assert_equal("foo&amp;bar", escape("foo&bar"))
+ assert_equal("foo&quot;bar", escape("foo\"bar"))
+ assert_equal("foo&gt;bar", escape("foo>bar"))
+ assert_equal("foo&lt;bar", escape("foo<bar"))
+ assert_equal("こんにちは", escape("こんにちは"))
+ end
+end