Add justification for suppressing warnings in Ruby test case
In the same file removed a useless class for comparing versions.
This commit is contained in:
parent
7963445048
commit
505ffde655
1 changed files with 5 additions and 16 deletions
|
|
@ -5,23 +5,12 @@
|
|||
|
||||
require 'swig_assert'
|
||||
|
||||
# helper class for comparing version strings
|
||||
class Version
|
||||
attr_reader :array
|
||||
def initialize(s)
|
||||
@array = s.split('.').map { |e| e.to_i }
|
||||
end
|
||||
def <(rhs)
|
||||
a = @array.clone
|
||||
b = rhs.array.clone
|
||||
a << 0 while a.size < b.size
|
||||
b << 0 while b.size < a.size
|
||||
(a <=> b) < 0
|
||||
end
|
||||
end
|
||||
|
||||
# This extension to the Warning class is intended for suppressing expected
|
||||
# Ruby warning messages about invalid or redefined Ruby constants - basically
|
||||
# the equivalent of %warnfilter(SWIGWARN_RUBY_WRONG_NAME) but for the moment
|
||||
# the wrapper library is loaded by the Ruby interpreter.
|
||||
# Note: This only works for Ruby 2.4 and later
|
||||
if Object.const_defined?(:Warning) && Warning.respond_to?(:warn)
|
||||
# suppressing warnings like this only works for Ruby 2.4 and later
|
||||
module CustomWarningFilter
|
||||
def warn(*args)
|
||||
msg = args[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue