Permalink
Browse files

Fix deprecated syntax for Ruby 1.9

  • Loading branch information...
1 parent 7e565d3 commit a729e43006f681bc0e8a349dfe85c67aa0d03755 @kkaempf kkaempf committed Mar 14, 2013
Showing with 24 additions and 19 deletions.
  1. +24 −19 tests/solver/runtest.rb
View
43 tests/solver/runtest.rb
@@ -66,25 +66,30 @@ def Solution.filediff name1, name2
a1 = f1.readlines
a2 = f2.readlines
i = 0
- a1.each { |l1|
- if (l1 =~ /unflag/)
- next
- end
- l2 = a2[i]
- if (l2 =~ /unflag/)
- i += 1
- retry
- end
- if l2
- if (l1 != l2)
- puts "- #{l1}"
- puts "+ #{l2}"
- end
- else
-# puts "- #{l1}"
+ retry_loop = true
+ while retry_loop do
+ retry_loop = false
+ a1.each do |l1|
+ if (l1 =~ /unflag/)
+ next
+ end
+ l2 = a2[i]
+ if (l2 =~ /unflag/)
+ i += 1
+ retry_loop = true # restart from beginning
+ break # was: retry, removed in Ruby 1.9
+ end
+ if l2
+ if (l1 != l2)
+ puts "- #{l1}"
+ puts "+ #{l2}"
+ end
+ else
+ # puts "- #{l1}"
+ end
+ i += 1
end
- i += 1
- }
+ end
while i < a2.size
puts "+ #{a2[i]}"
i += 1
@@ -280,7 +285,7 @@ class Runner
def run wd, arg, recurse=nil
fullname = arg
- if wd:
+ if wd
fullname = File.join( wd, arg )
end
#puts "Examine #{fullname}"

0 comments on commit a729e43

Please sign in to comment.