summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rake_tasks/test.rake7
-rw-r--r--test/scanners/c/empty.expected.raydebug (renamed from test/scanners/c/empty.out.raydebug)0
-rw-r--r--test/scanners/c/error.expected.raydebug (renamed from test/scanners/c/error.out.raydebug)0
-rw-r--r--test/scanners/c/error2.expected.raydebug (renamed from test/scanners/c/error2.out.raydebug)0
-rw-r--r--test/scanners/c/open-string.expected.raydebug (renamed from test/scanners/c/open-string.out.raydebug)0
-rw-r--r--test/scanners/c/strange.expected.raydebug (renamed from test/scanners/c/strange.out.raydebug)0
-rw-r--r--test/scanners/coderay_suite.rb22
-rw-r--r--test/scanners/delphi/pluto.expected.raydebug (renamed from test/scanners/delphi/pluto.out.raydebug)0
-rw-r--r--test/scanners/delphi/ytools.expected.raydebug (renamed from test/scanners/delphi/ytools.out.raydebug)0
-rw-r--r--test/scanners/html/ampersand.expected.raydebug (renamed from test/scanners/html/ampersand.out.raydebug)0
-rw-r--r--test/scanners/html/tolkien.expected.raydebug (renamed from test/scanners/html/tolkien.out.raydebug)0
-rw-r--r--test/scanners/nitro/tags.expected.raydebug (renamed from test/scanners/nitro/tags.out.raydebug)0
-rw-r--r--test/scanners/rhtml/day.expected.raydebug (renamed from test/scanners/rhtml/day.out.raydebug)0
-rw-r--r--test/scanners/ruby/1.expected.raydebug (renamed from test/scanners/ruby/1.out.raydebug)0
-rw-r--r--test/scanners/ruby/besetzung.expected.raydebug (renamed from test/scanners/ruby/besetzung.out.raydebug)bin3105 -> 3105 bytes
-rw-r--r--test/scanners/ruby/class.expected.raydebug (renamed from test/scanners/ruby/class.out.raydebug)0
-rw-r--r--test/scanners/ruby/comment.expected.raydebug (renamed from test/scanners/ruby/comment.out.raydebug)0
-rw-r--r--test/scanners/ruby/diffed.expected.raydebug (renamed from test/scanners/ruby/diffed.out.raydebug)0
-rw-r--r--test/scanners/ruby/evil.expected.raydebug (renamed from test/scanners/ruby/evil.out.raydebug)0
-rw-r--r--test/scanners/ruby/example.expected.raydebug (renamed from test/scanners/ruby/example.out.raydebug)0
-rw-r--r--test/scanners/ruby/jarh.expected.raydebug (renamed from test/scanners/ruby/jarh.out.raydebug)0
-rw-r--r--test/scanners/ruby/open-heredoc.expected.raydebug (renamed from test/scanners/ruby/open-heredoc.out.raydebug)0
-rw-r--r--test/scanners/ruby/open-inline.expected.raydebug (renamed from test/scanners/ruby/open-inline.out.raydebug)0
-rw-r--r--test/scanners/ruby/open-string.expected.raydebug (renamed from test/scanners/ruby/open-string.out.raydebug)0
-rw-r--r--test/scanners/ruby/pleac.expected.raydebug (renamed from test/scanners/ruby/pleac.out.raydebug)0
-rw-r--r--test/scanners/ruby/quotes.expected.raydebug (renamed from test/scanners/ruby/quotes.out.raydebug)0
-rw-r--r--test/scanners/ruby/sidebarize.expected.raydebug (renamed from test/scanners/ruby/sidebarize.out.raydebug)0
-rw-r--r--test/scanners/ruby/simple.expected.raydebug (renamed from test/scanners/ruby/simple.out.raydebug)0
-rw-r--r--test/scanners/ruby/strange.expected.raydebug (renamed from test/scanners/ruby/strange.out.raydebug)0
-rw-r--r--test/scanners/ruby/test-fitter.expected.raydebug (renamed from test/scanners/ruby/test-fitter.out.raydebug)0
-rw-r--r--test/scanners/ruby/tk-calc.expected.raydebug (renamed from test/scanners/ruby/tk-calc.out.raydebug)0
-rw-r--r--test/scanners/ruby/undef.expected.raydebug (renamed from test/scanners/ruby/undef.out.raydebug)0
-rw-r--r--test/scanners/ruby/zero.expected.raydebug (renamed from test/scanners/ruby/zero.out.raydebug)0
-rw-r--r--test/scanners/xml/kate.expected.raydebug (renamed from test/scanners/xml/kate.out.raydebug)0
34 files changed, 20 insertions, 9 deletions
diff --git a/rake_tasks/test.rake b/rake_tasks/test.rake
index 18e10d7..20bcf43 100644
--- a/rake_tasks/test.rake
+++ b/rake_tasks/test.rake
@@ -8,6 +8,13 @@ namespace :test do
task :scanners do
system 'ruby -wd ./test/scanners/suite.rb'
end
+
+ desc 'Clean test output files'
+ task :clean do
+ for file in Dir['test/scanners/**/*.actual.*']
+ rm file
+ end
+ end
end
task :test => %w( test:scanners )
diff --git a/test/scanners/c/empty.out.raydebug b/test/scanners/c/empty.expected.raydebug
index e69de29..e69de29 100644
--- a/test/scanners/c/empty.out.raydebug
+++ b/test/scanners/c/empty.expected.raydebug
diff --git a/test/scanners/c/error.out.raydebug b/test/scanners/c/error.expected.raydebug
index a52becb..a52becb 100644
--- a/test/scanners/c/error.out.raydebug
+++ b/test/scanners/c/error.expected.raydebug
diff --git a/test/scanners/c/error2.out.raydebug b/test/scanners/c/error2.expected.raydebug
index ccd2125..ccd2125 100644
--- a/test/scanners/c/error2.out.raydebug
+++ b/test/scanners/c/error2.expected.raydebug
diff --git a/test/scanners/c/open-string.out.raydebug b/test/scanners/c/open-string.expected.raydebug
index a6afd22..a6afd22 100644
--- a/test/scanners/c/open-string.out.raydebug
+++ b/test/scanners/c/open-string.expected.raydebug
diff --git a/test/scanners/c/strange.out.raydebug b/test/scanners/c/strange.expected.raydebug
index 8979a50..8979a50 100644
--- a/test/scanners/c/strange.out.raydebug
+++ b/test/scanners/c/strange.expected.raydebug
diff --git a/test/scanners/coderay_suite.rb b/test/scanners/coderay_suite.rb
index 8425cef..c498f2e 100644
--- a/test/scanners/coderay_suite.rb
+++ b/test/scanners/coderay_suite.rb
@@ -93,7 +93,7 @@ module CodeRay
next if ENV['testonly'] and ENV['testonly'] != File.basename(input, ".#{extension}")
print "testing #{input}: "
name = File.basename(input, ".#{extension}")
- output = name + '.out.' + tokenizer.file_extension
+ expected_filename = name + '.expected.' + tokenizer.file_extension
code = File.open(input, 'rb') { |f| break f.read }
unless ENV['noincremental']
@@ -144,18 +144,22 @@ module CodeRay
tokens = scanner.tokens
result = tokenizer.encode_tokens tokens
- if File.exist? output
- expected = File.open(output, 'rb') { |f| break f.read }
+ if File.exist? expected_filename
+ expected = File.open(expected_filename, 'rb') { |f| break f.read }
ok = expected == result
- computed = output.sub('.out.', '.computed.')
+ actual_filename = expected_filename.sub('.expected.', '.actual.')
unless ok
- File.open(computed, 'wb') { |f| f.write result }
- print `gvimdiff #{output} #{computed}` if ENV['diff']
+ File.open(actual_filename, 'wb') { |f| f.write result }
+ if ENV['diff']
+ print `gvimdiff #{expected_filename} #{actual_filename}`
+ end
+ end
+ unless ENV['diff'] or ENV['noassert']
+ assert(ok, "Scan error: unexpected output")
end
- assert(ok, "Scan error: #{computed} != #{output}") unless ENV['diff'] or ENV['noassert']
else
- File.open(output, 'wb') do |f| f.write result end
- puts "New test: #{output}"
+ File.open(expected_filename, 'wb') { |f| f.write result }
+ puts "New test: #{expected_filename}"
end
print 'highlighting, '
diff --git a/test/scanners/delphi/pluto.out.raydebug b/test/scanners/delphi/pluto.expected.raydebug
index 032e8d4..032e8d4 100644
--- a/test/scanners/delphi/pluto.out.raydebug
+++ b/test/scanners/delphi/pluto.expected.raydebug
diff --git a/test/scanners/delphi/ytools.out.raydebug b/test/scanners/delphi/ytools.expected.raydebug
index f1621fd..f1621fd 100644
--- a/test/scanners/delphi/ytools.out.raydebug
+++ b/test/scanners/delphi/ytools.expected.raydebug
diff --git a/test/scanners/html/ampersand.out.raydebug b/test/scanners/html/ampersand.expected.raydebug
index 0e0b464..0e0b464 100644
--- a/test/scanners/html/ampersand.out.raydebug
+++ b/test/scanners/html/ampersand.expected.raydebug
diff --git a/test/scanners/html/tolkien.out.raydebug b/test/scanners/html/tolkien.expected.raydebug
index 653ddd0..653ddd0 100644
--- a/test/scanners/html/tolkien.out.raydebug
+++ b/test/scanners/html/tolkien.expected.raydebug
diff --git a/test/scanners/nitro/tags.out.raydebug b/test/scanners/nitro/tags.expected.raydebug
index 7ce6076..7ce6076 100644
--- a/test/scanners/nitro/tags.out.raydebug
+++ b/test/scanners/nitro/tags.expected.raydebug
diff --git a/test/scanners/rhtml/day.out.raydebug b/test/scanners/rhtml/day.expected.raydebug
index 7440d64..7440d64 100644
--- a/test/scanners/rhtml/day.out.raydebug
+++ b/test/scanners/rhtml/day.expected.raydebug
diff --git a/test/scanners/ruby/1.out.raydebug b/test/scanners/ruby/1.expected.raydebug
index 510e7c6..510e7c6 100644
--- a/test/scanners/ruby/1.out.raydebug
+++ b/test/scanners/ruby/1.expected.raydebug
diff --git a/test/scanners/ruby/besetzung.out.raydebug b/test/scanners/ruby/besetzung.expected.raydebug
index d65e4fc..d65e4fc 100644
--- a/test/scanners/ruby/besetzung.out.raydebug
+++ b/test/scanners/ruby/besetzung.expected.raydebug
Binary files differ
diff --git a/test/scanners/ruby/class.out.raydebug b/test/scanners/ruby/class.expected.raydebug
index af7a63a..af7a63a 100644
--- a/test/scanners/ruby/class.out.raydebug
+++ b/test/scanners/ruby/class.expected.raydebug
diff --git a/test/scanners/ruby/comment.out.raydebug b/test/scanners/ruby/comment.expected.raydebug
index 0e24ae3..0e24ae3 100644
--- a/test/scanners/ruby/comment.out.raydebug
+++ b/test/scanners/ruby/comment.expected.raydebug
diff --git a/test/scanners/ruby/diffed.out.raydebug b/test/scanners/ruby/diffed.expected.raydebug
index 8881649..8881649 100644
--- a/test/scanners/ruby/diffed.out.raydebug
+++ b/test/scanners/ruby/diffed.expected.raydebug
diff --git a/test/scanners/ruby/evil.out.raydebug b/test/scanners/ruby/evil.expected.raydebug
index b1e3231..b1e3231 100644
--- a/test/scanners/ruby/evil.out.raydebug
+++ b/test/scanners/ruby/evil.expected.raydebug
diff --git a/test/scanners/ruby/example.out.raydebug b/test/scanners/ruby/example.expected.raydebug
index be68a13..be68a13 100644
--- a/test/scanners/ruby/example.out.raydebug
+++ b/test/scanners/ruby/example.expected.raydebug
diff --git a/test/scanners/ruby/jarh.out.raydebug b/test/scanners/ruby/jarh.expected.raydebug
index a1eb7fc..a1eb7fc 100644
--- a/test/scanners/ruby/jarh.out.raydebug
+++ b/test/scanners/ruby/jarh.expected.raydebug
diff --git a/test/scanners/ruby/open-heredoc.out.raydebug b/test/scanners/ruby/open-heredoc.expected.raydebug
index 72fae77..72fae77 100644
--- a/test/scanners/ruby/open-heredoc.out.raydebug
+++ b/test/scanners/ruby/open-heredoc.expected.raydebug
diff --git a/test/scanners/ruby/open-inline.out.raydebug b/test/scanners/ruby/open-inline.expected.raydebug
index 03af29e..03af29e 100644
--- a/test/scanners/ruby/open-inline.out.raydebug
+++ b/test/scanners/ruby/open-inline.expected.raydebug
diff --git a/test/scanners/ruby/open-string.out.raydebug b/test/scanners/ruby/open-string.expected.raydebug
index e44c295..e44c295 100644
--- a/test/scanners/ruby/open-string.out.raydebug
+++ b/test/scanners/ruby/open-string.expected.raydebug
diff --git a/test/scanners/ruby/pleac.out.raydebug b/test/scanners/ruby/pleac.expected.raydebug
index c6fcd8c..c6fcd8c 100644
--- a/test/scanners/ruby/pleac.out.raydebug
+++ b/test/scanners/ruby/pleac.expected.raydebug
diff --git a/test/scanners/ruby/quotes.out.raydebug b/test/scanners/ruby/quotes.expected.raydebug
index 61fff05..61fff05 100644
--- a/test/scanners/ruby/quotes.out.raydebug
+++ b/test/scanners/ruby/quotes.expected.raydebug
diff --git a/test/scanners/ruby/sidebarize.out.raydebug b/test/scanners/ruby/sidebarize.expected.raydebug
index fb7e255..fb7e255 100644
--- a/test/scanners/ruby/sidebarize.out.raydebug
+++ b/test/scanners/ruby/sidebarize.expected.raydebug
diff --git a/test/scanners/ruby/simple.out.raydebug b/test/scanners/ruby/simple.expected.raydebug
index b423e9f..b423e9f 100644
--- a/test/scanners/ruby/simple.out.raydebug
+++ b/test/scanners/ruby/simple.expected.raydebug
diff --git a/test/scanners/ruby/strange.out.raydebug b/test/scanners/ruby/strange.expected.raydebug
index b2f7d50..b2f7d50 100644
--- a/test/scanners/ruby/strange.out.raydebug
+++ b/test/scanners/ruby/strange.expected.raydebug
diff --git a/test/scanners/ruby/test-fitter.out.raydebug b/test/scanners/ruby/test-fitter.expected.raydebug
index da35d8d..da35d8d 100644
--- a/test/scanners/ruby/test-fitter.out.raydebug
+++ b/test/scanners/ruby/test-fitter.expected.raydebug
diff --git a/test/scanners/ruby/tk-calc.out.raydebug b/test/scanners/ruby/tk-calc.expected.raydebug
index 4bd4db0..4bd4db0 100644
--- a/test/scanners/ruby/tk-calc.out.raydebug
+++ b/test/scanners/ruby/tk-calc.expected.raydebug
diff --git a/test/scanners/ruby/undef.out.raydebug b/test/scanners/ruby/undef.expected.raydebug
index e306858..e306858 100644
--- a/test/scanners/ruby/undef.out.raydebug
+++ b/test/scanners/ruby/undef.expected.raydebug
diff --git a/test/scanners/ruby/zero.out.raydebug b/test/scanners/ruby/zero.expected.raydebug
index e69de29..e69de29 100644
--- a/test/scanners/ruby/zero.out.raydebug
+++ b/test/scanners/ruby/zero.expected.raydebug
diff --git a/test/scanners/xml/kate.out.raydebug b/test/scanners/xml/kate.expected.raydebug
index 01eec5a..01eec5a 100644
--- a/test/scanners/xml/kate.out.raydebug
+++ b/test/scanners/xml/kate.expected.raydebug