summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-07-21 18:53:41 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-07-21 19:00:48 +0200
commit2ab42c7b5e674453fac0320fe0c4a40daf6197e1 (patch)
treeec4dfef02f1e9d8e06a75551e9e6030598a2255d /test
parent6ef7fa4541230442b6e743042648320619ad6859 (diff)
downloadcoderay-2ab42c7b5e674453fac0320fe0c4a40daf6197e1.tar.gz
prevent Symbol attack in Debug scanner
Diffstat (limited to 'test')
-rw-r--r--test/unit/debug.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/debug.rb b/test/unit/debug.rb
index f2b80bd..616cda5 100644
--- a/test/unit/debug.rb
+++ b/test/unit/debug.rb
@@ -18,15 +18,15 @@ class DebugEncoderTest < Test::Unit::TestCase
[:begin_group, :string],
['test', :content],
[:end_group, :string],
- [:begin_line, :test],
+ [:begin_line, :head],
["\n", :space],
["\n \t", :space],
[" \n", :space],
["[]", :method],
- [:end_line, :test],
+ [:end_line, :head],
].flatten
TEST_OUTPUT = <<-'DEBUG'.chomp
-integer(10)operator((\\\))string<content(test)>test[
+integer(10)operator((\\\))string<content(test)>head[
method([])]
@@ -51,7 +51,7 @@ class DebugScannerTest < Test::Unit::TestCase
end
TEST_INPUT = <<-'DEBUG'.chomp
-integer(10)operator((\\\))string<content(test)>test[
+integer(10)operator((\\\))string<content(test)>head[
method([])]
@@ -62,10 +62,10 @@ method([])]
[:begin_group, :string],
['test', :content],
[:end_group, :string],
- [:begin_line, :test],
+ [:begin_line, :head],
["\n\n \t \n", :space],
["[]", :method],
- [:end_line, :test],
+ [:end_line, :head],
].flatten
def test_filtering_text_tokens