Skip to content

Commit

Permalink
Showing 38 changed files with 411 additions and 132 deletions.
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ public boolean equalNull(RubyHash a, RubyHash b) {
}

@Specialization
public boolean equal(VirtualFrame frame, RubyHash a, RubyHash b) {
public boolean equal(RubyHash a, RubyHash b) {
notDesignedForCompilation();

final List<KeyValue> aEntries = HashOperations.verySlowToKeyValues(a);
@@ -95,6 +95,12 @@ public boolean equal(VirtualFrame frame, RubyHash a, RubyHash b) {

return true;
}

@Specialization(guards = "!isRubyHash(arguments[1])")
public boolean equalNonHash(RubyHash a, Object b) {
return false;
}

}

@CoreMethod(names = "[]", onSingleton = true, argumentsAsArray = true)
53 changes: 29 additions & 24 deletions core/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
Original file line number Diff line number Diff line change
@@ -839,8 +839,9 @@ private RubyNode translateCPath(SourceSection sourceSection, org.jruby.ast.Colon
public RubyNode visitComplexNode(ComplexNode node) {
final SourceSection sourceSection = translate(node.getPosition());

// TODO: implement Complex
return node.getNumber().accept(this);
return translateRationalComplex(sourceSection, "Complex",
new FixnumLiteralNode.IntegerFixnumLiteralNode(context, sourceSection, 0),
node.getNumber().accept(this));
}

@Override
@@ -1007,7 +1008,7 @@ protected RubyNode translateMethodDefinition(SourceSection sourceSection, RubyNo
* In the top-level, methods are defined in the class of the main object. This is
* counter-intuitive - I would have expected them to be defined in the singleton class.
* Apparently this is a design decision to make top-level methods sort of global.
*
*
* http://stackoverflow.com/questions/1761148/where-are-methods-defined-at-the-ruby-top-level
*/

@@ -1105,39 +1106,39 @@ public RubyNode visitFloatNode(org.jruby.ast.FloatNode node) {
public RubyNode visitForNode(org.jruby.ast.ForNode node) {
/**
* A Ruby for-loop, such as:
*
*
* <pre>
* for x in y
* z = x
* puts z
* end
* </pre>
*
*
* naively desugars to:
*
*
* <pre>
* y.each do |x|
* z = x
* puts z
* end
* </pre>
*
*
* The main difference is that z is always going to be local to the scope outside the block,
* so it's a bit more like:
*
*
* <pre>
* z = nil unless z is already defined
* y.each do |x|
* z = x
* puts x
* end
* </pre>
*
*
* Which forces z to be defined in the correct scope. The parser already correctly calls z a
* local, but then that causes us a problem as if we're going to translate to a block we
* need a formal parameter - not a local variable. My solution to this is to add a
* temporary:
*
*
* <pre>
* z = nil unless z is already defined
* y.each do |temp|
@@ -1146,25 +1147,25 @@ public RubyNode visitForNode(org.jruby.ast.ForNode node) {
* puts x
* end
* </pre>
*
*
* We also need that temp because the expression assigned in the for could be index
* assignment, multiple assignment, or whatever:
*
*
* <pre>
* for x[0] in y
* z = x[0]
* puts z
* end
* </pre>
*
*
* http://blog.grayproductions.net/articles/the_evils_of_the_for_loop
* http://stackoverflow.com/questions/3294509/for-vs-each-in-ruby
*
*
* The other complication is that normal locals should be defined in the enclosing scope,
* unlike a normal block. We do that by setting a flag on this translator object when we
* visit the new iter, translatingForStatement, which we recognise when visiting an iter
* node.
*
*
* Finally, note that JRuby's terminology is strange here. Normally 'iter' is a different
* term for a block. Here, JRuby calls the object being iterated over the 'iter'.
*/
@@ -1229,7 +1230,7 @@ private static org.jruby.ast.Node setRHS(org.jruby.ast.Node node, org.jruby.ast.

private final Set<String> readOnlyGlobalVariables = new HashSet<String>();
private final Map<String, String> globalVariableAliases = new HashMap<String, String>();

private void initReadOnlyGlobalVariables() {
Set<String> s = readOnlyGlobalVariables;
s.add("$:");
@@ -1244,7 +1245,7 @@ private void initReadOnlyGlobalVariables() {
s.add("$-l");
s.add("$-p");
}

private void initGlobalVariableAliases() {
Map<String, String> m = globalVariableAliases;
m.put("$-I", "$LOAD_PATH");
@@ -2032,7 +2033,7 @@ public RubyNode visitOpAsgnNode(org.jruby.ast.OpAsgnNode node) {
/*
* We're going to de-sugar a.foo += c into a.foo = a.foo + c. Note that we can't evaluate a
* more than once, so we put it into a temporary, and we're doing something more like:
*
*
* temp = a; temp.foo = temp.foo + c
*/

@@ -2168,19 +2169,23 @@ public RubyNode visitPostExeNode(PostExeNode node) {
public RubyNode visitRationalNode(RationalNode node) {
final SourceSection sourceSection = translate(node.getPosition());

// Translate as Rubinius.privately { Rubinius.convert(a, b) }

// TODO(CS): use IntFixnumLiteralNode where possible

return translateRationalComplex(sourceSection, "Rational",
new FixnumLiteralNode.LongFixnumLiteralNode(context, sourceSection, node.getNumerator()),
new FixnumLiteralNode.LongFixnumLiteralNode(context, sourceSection, node.getDenominator()));
}

private RubyNode translateRationalComplex(SourceSection sourceSection, String name, RubyNode a, RubyNode b) {
// Translate as Rubinius.privately { Rational.convert(a, b) }

final LexicalScope lexicalScope = environment.getLexicalScope();
final RubyNode moduleNode = new LexicalScopeNode(context, sourceSection, lexicalScope);
return new RubyCallNode(
context, sourceSection, "convert",
new ReadConstantNode(context, sourceSection, "Rational", moduleNode, lexicalScope),
new ReadConstantNode(context, sourceSection, name, moduleNode, lexicalScope),
null, false, true, false,
new RubyNode[]{
new FixnumLiteralNode.LongFixnumLiteralNode(context, sourceSection, node.getNumerator()),
new FixnumLiteralNode.LongFixnumLiteralNode(context, sourceSection, node.getDenominator())});
new RubyNode[]{a, b});
}

@Override
1 change: 1 addition & 0 deletions core/src/main/ruby/jruby/truffle/core.rb
Original file line number Diff line number Diff line change
@@ -53,5 +53,6 @@
require_relative 'core/rubinius/kernel/common/immediate'
require_relative 'core/rubinius/kernel/common/true'
require_relative 'core/rubinius/kernel/common/false'
require_relative 'core/rubinius/kernel/common/complex'

require_relative 'core/shims'
3 changes: 0 additions & 3 deletions core/src/main/ruby/jruby/truffle/core/main.rb
Original file line number Diff line number Diff line change
@@ -6,9 +6,6 @@
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

TRUE = true
FALSE = false

module STDIN
def self.external_encoding
@external || Encoding.default_external
Original file line number Diff line number Diff line change
@@ -0,0 +1,363 @@
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Rubinius nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#
# complex.rb -
# $Release Version: 0.5 $
# $Revision: 1.3 $
# $Date: 1998/07/08 10:05:28 $
# by Keiju ISHITSUKA(SHL Japan Inc.)
#

class Complex < Numeric

# TODO(CS 7 Jan 15) we don't define all these methods yet

#undef_method :%
#undef_method :<
#undef_method :<=
#undef_method :<=>
#undef_method :>
#undef_method :>=
#undef_method :between?
#undef_method :div
#undef_method :divmod
#undef_method :floor
#undef_method :ceil
#undef_method :modulo
#undef_method :remainder
#undef_method :round
#undef_method :step
#undef_method :truncate
#undef_method :i

def self.convert(real, imag = undefined)
if real.equal?(nil) || imag.equal?(nil)
raise TypeError, "cannot convert nil into Complex"
end

real = real.to_c if real.kind_of?(String)
imag = imag.to_c if imag.kind_of?(String)

if real.kind_of?(Complex) && !real.imag.kind_of?(Float) && real.imag == 0
real = real.real
end

if imag.kind_of?(Complex) && !imag.imag.kind_of?(Float) && imag.imag == 0
imag = imag.real
end

if real.kind_of?(Complex) && !imag.kind_of?(Float) && imag == 0
return real
end

if undefined.equal?(imag)
if real.kind_of?(Numeric) && !real.real?
return real
elsif !real.kind_of?(Numeric)
return Rubinius::Type.coerce_to(real, Complex, :to_c)
else
imag = 0
end
elsif real.kind_of?(Numeric) && imag.kind_of?(Numeric) && (!real.real? || !imag.real?)
return real + imag * Complex.new(0, 1)
end

return real if Rubinius.mathn_loaded? && imag.equal?(0)
rect(real, imag)
end

private_class_method :convert

def Complex.generic?(other) # :nodoc:
other.kind_of?(Integer) or
other.kind_of?(Float) or
(defined?(Rational) and other.kind_of?(Rational))
end

def Complex.rect(real, imag=0)
raise TypeError, 'not a real' unless check_real?(real) && check_real?(imag)
new(real, imag)
end
class << self; alias_method :rectangular, :rect end

def Complex.polar(r, theta=0)
raise TypeError, 'not a real' unless check_real?(r) && check_real?(theta)

Complex(r*Math.cos(theta), r*Math.sin(theta))
end

def Complex.check_real?(obj)
obj.kind_of?(Numeric) && obj.real?
end
private_class_method :check_real?

def initialize(a, b = 0)
@real = a
@imag = b
end

def -@
Complex(-real, -imag)
end

def +(other)
if other.kind_of?(Complex)
Complex(real + other.real, imag + other.imag)
elsif other.kind_of?(Numeric) && other.real?
Complex(real + other, imag)
else
redo_coerced(:+, other)
end
end

def -(other)
if other.kind_of?(Complex)
Complex(real - other.real, imag - other.imag)
elsif other.kind_of?(Numeric) && other.real?
Complex(real - other, imag)
else
redo_coerced(:-, other)
end
end

def *(other)
if other.kind_of?(Complex)
Complex(real * other.real - imag * other.imag,
real * other.imag + imag * other.real)
elsif other.kind_of?(Numeric) && other.real?
Complex(real * other, imag * other)
else
redo_coerced(:*, other)
end
end

def divide(other)
if other.kind_of?(Complex)
self * other.conjugate / other.abs2
elsif other.kind_of?(Numeric) && other.real?
Complex(real.quo(other), imag.quo(other))
else
redo_coerced(:quo, other)
end
end

alias_method :/, :divide
alias_method :quo, :divide

def ** (other)
if !other.kind_of?(Float) && other == 0
return Complex(1)
end
if other.kind_of?(Complex)
r, theta = polar
ore = other.real
oim = other.imag
nr = Math.exp(ore*Math.log(r) - oim * theta)
ntheta = theta*ore + oim*Math.log(r)
Complex.polar(nr, ntheta)
elsif other.kind_of?(Integer)
if other > 0
x = self
z = x
n = other - 1
while n != 0
while (div, mod = n.divmod(2)
mod == 0)
x = Complex(x.real*x.real - x.imag*x.imag, 2*x.real*x.imag)
n = div
end
z *= x
n -= 1
end
z
else
if defined? Rational
(Rational.new(1, 1) / self) ** -other
else
self ** Float(other)
end
end
elsif Complex.generic?(other)
r, theta = polar
Complex.polar(r**other, theta*other)
else
x, y = other.coerce(self)
x**y
end
end

def abs
Math.hypot(@real, @imag)
end

alias_method :magnitude, :abs

def abs2
@real*@real + @imag*@imag
end

def arg
Math.atan2(@imag, @real)
end
alias_method :angle, :arg
alias_method :phase, :arg

def polar
[abs, arg]
end

def conjugate
Complex(@real, -@imag)
end
alias conj conjugate

def ==(other)
if other.kind_of?(Complex)
real == other.real && imag == other.imag
elsif other.kind_of?(Numeric) && other.real?
real == other && imag == 0
else
other == self
end
end

def eql?(other)
other.kind_of?(Complex) and
imag.class == other.imag.class and
real.class == other.real.class and
self == other
end

def coerce(other)
if other.kind_of?(Numeric) && other.real?
[Complex.new(other, 0), self]
elsif other.kind_of?(Complex)
[other, self]
else
raise TypeError, "#{other.class} can't be coerced into Complex"
end
end

def denominator
@real.denominator.lcm(@imag.denominator)
end

def numerator
cd = denominator
Complex(@real.numerator*(cd/@real.denominator),
@imag.numerator*(cd/@imag.denominator))
end

def real?
false
end

def rect
[@real, @imag]
end

alias_method :rectangular, :rect

def to_f
raise RangeError, "can't convert #{self} into Float" unless !imag.kind_of?(Float) && imag == 0
real.to_f
end

def to_i
raise RangeError, "can't convert #{self} into Integer" unless !imag.kind_of?(Float) && imag == 0
real.to_i
end

def to_r
raise RangeError, "can't' convert #{self} into Rational" unless !imag.kind_of?(Float) && imag == 0
real.to_r
end

def rationalize(eps = nil)
raise RangeError, "can't' convert #{self} into Rational" unless !imag.kind_of?(Float) && imag == 0
real.rationalize(eps)
end

def to_s
result = real.to_s

if imag.kind_of?(Float) ? !imag.nan? && imag.negative? : imag < 0
result << "-"
else
result << "+"
end

imag_s = imag.abs.to_s
result << imag_s

unless imag_s[-1] =~ /\d/
result << "*"
end

result << "i"
result
end

def hash
@real.hash ^ @imag.hash
end

def inspect
"(#{to_s})"
end

def fdiv(other)
raise TypeError, "#{other.class} can't be coerced into Complex" unless other.is_a?(Numeric)

# FIXME
self / other
end

def marshal_dump
ary = [real, imag]
instance_variables.each do |ivar|
ary.instance_variable_set(ivar, instance_variable_get(ivar))
end
ary
end

private :marshal_dump

def marshal_load(ary)
@real, @imag = ary
ary.instance_variables.each do |ivar|
instance_variable_set(ivar, ary.instance_variable_get(ivar))
end
self
end

I = Complex(0, 1)

attr_reader :real
attr_reader :imag
alias_method :imaginary, :imag
end
Original file line number Diff line number Diff line change
@@ -27,6 +27,13 @@
# Only part of Rubinius' kernel.rb

module Kernel

def Complex(*args)
Rubinius.privately do
Complex.convert(*args)
end
end
module_function :Complex

def Rational(a, b = 1)
Rubinius.privately do
Original file line number Diff line number Diff line change
@@ -41,4 +41,8 @@ def div(other)
self.__slash__(other).floor
end

def real?
true
end

end
11 changes: 0 additions & 11 deletions core/src/main/ruby/jruby/truffle/core/shims.rb
Original file line number Diff line number Diff line change
@@ -17,17 +17,6 @@ def eql?(other)

end

class Complex
end

module Kernel

def Complex(real, imaginary)
imaginary
end

end

class Channel
end

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/abs2_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/abs_tags.txt

This file was deleted.

10 changes: 0 additions & 10 deletions spec/truffle/tags/core/complex/coerce_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/conj_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/conjugate_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/constants_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/divide_tags.txt
Original file line number Diff line number Diff line change
@@ -6,5 +6,4 @@ fails:Complex#/ with Bignum divides both parts of the Complex number
fails:Complex#/ with Float divides both parts of the Complex number
fails:Complex#/ with Float returns Complex(Infinity, Infinity) when given zero
fails:Complex#/ with Object tries to coerce self into other
fails:Complex#/ with a Numeric which responds to #real? with true returns Complex(real.quo(other), imag.quo(other))
fails:Complex#/ with a Numeric which responds to #real? with false coerces the passed argument to Complex and divides the resulting elements
6 changes: 0 additions & 6 deletions spec/truffle/tags/core/complex/eql_tags.txt

This file was deleted.

6 changes: 0 additions & 6 deletions spec/truffle/tags/core/complex/equal_value_tags.txt

This file was deleted.

4 changes: 0 additions & 4 deletions spec/truffle/tags/core/complex/exponent_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
fails:Complex#** with Fixnum 0 returns Complex(1)
fails:Complex#** with Float 0.0 returns Complex(1.0, 0.0)
fails:Complex#** with Complex returns self raised to the given power
fails:Complex#** with Integer returns self raised to the given power
fails:Complex#** with Rational returns self raised to the given power
fails:Complex#** with Object tries to coerce self into other
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/complex/fdiv_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:Complex#fdiv accepts a numeric argument
fails:Complex#fdiv accepts a negative numeric argument
fails:Complex#fdiv raises a TypeError if passed a non-numeric argument
fails:Complex#fdiv sets the real part to NaN if self's real part is NaN
fails:Complex#fdiv sets the imaginary part to NaN if self's imaginary part is NaN
fails:Complex#fdiv sets the real and imaginary part to NaN if self's real and imaginary parts are NaN
1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/hash_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/imag_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/imaginary_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/magnitude_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/complex/marshal_dump_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/complex/minus_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fails:Complex#- with Complex subtracts both the real and imaginary components
fails:Complex#- with Integer subtracts the real number from the real component of self
fails:Complex#- with Object tries to coerce self into other
fails:Complex#- passed Numeric which responds to #real? with true coerces the passed argument to the type of the real part and subtracts the resulting elements
fails:Complex#- passed Numeric which responds to #real? with false coerces the passed argument to Complex and subtracts the resulting elements
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/complex/multiply_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
fails:Complex#* with Complex multiplies according to the usual rule for complex numbers: (a + bi) * (c + di) = ac - bd + (ad + bc)i
fails:Complex#* with Integer multiplies both parts of self by the given Integer
fails:Complex#* with Object tries to coerce self into other
fails:Complex#* with a Numeric which responds to #real? with true multiples both parts of self by other
fails:Complex#* with a Numeric which responds to #real? with true with a Numeric which responds to #real? with false coerces the passed argument to Complex and multiplies the resulting elements
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/complex/plus_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
fails:Complex#+ with Complex adds both the real and imaginary components
fails:Complex#+ with Integer adds the real number to the real component of self
fails:Complex#+ with Object tries to coerce self into other
fails:Complex#+ passed Numeric which responds to #real? with true coerces the passed argument to the type of the real part and adds the resulting elements
fails:Complex#+ passed Numeric which responds to #real? with false coerces the passed argument to Complex and adds the resulting elements
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/complex/polar_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Complex.polar returns a complex number in terms of radius and angle
fails:Complex.polar raises a TypeError when given non real arguments
fails:Complex#polar returns the absolute value and the argument
1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/quo_tags.txt
Original file line number Diff line number Diff line change
@@ -6,5 +6,4 @@ fails:Complex#quo with Bignum divides both parts of the Complex number
fails:Complex#quo with Float divides both parts of the Complex number
fails:Complex#quo with Float returns Complex(Infinity, Infinity) when given zero
fails:Complex#quo with Object tries to coerce self into other
fails:Complex#quo with a Numeric which responds to #real? with true returns Complex(real.quo(other), imag.quo(other))
fails:Complex#quo with a Numeric which responds to #real? with false coerces the passed argument to Complex and divides the resulting elements
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/complex/rationalize_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:Complex#rationalize raises RangeError if self has non-zero imaginary part
fails:Complex#rationalize raises RangeError if self has 0.0 imaginary part
fails:Complex#rationalize returns a Rational if self has zero imaginary part
fails:Complex#rationalize sends #rationalize to the real part
fails:Complex#rationalize ignores a single argument
fails:Complex#rationalize raises ArgumentError when passed more than one argument
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/complex/real_tags.txt

This file was deleted.

10 changes: 0 additions & 10 deletions spec/truffle/tags/core/complex/rect_tags.txt

This file was deleted.

10 changes: 0 additions & 10 deletions spec/truffle/tags/core/complex/rectangular_tags.txt

This file was deleted.

4 changes: 0 additions & 4 deletions spec/truffle/tags/core/complex/to_f_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
fails:Complex#to_f when the imaginary part is Fixnum 0 returns the result of sending #to_f to the real part
fails:Complex#to_f when the imaginary part is Rational 0 returns the result of sending #to_f to the real part
fails:Complex#to_f when the imaginary part responds to #== 0 with true returns the result of sending #to_f to the real part
fails:Complex#to_f when the imaginary part is non-zero raises RangeError
fails:Complex#to_f when the imaginary part is Float 0.0 raises RangeError
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/complex/to_i_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
fails:Complex#to_i when the imaginary part is Fixnum 0 returns the result of sending #to_i to the real part
fails:Complex#to_i when the imaginary part is Rational 0 returns the result of sending #to_i to the real part
fails:Complex#to_i when the imaginary part responds to #== 0 with true returns the result of sending #to_i to the real part
fails:Complex#to_i when the imaginary part is non-zero raises RangeError
fails:Complex#to_i when the imaginary part is Float 0.0 raises RangeError
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/complex/to_r_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
fails:Complex#to_r when the imaginary part is Fixnum 0 returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part is Rational 0 returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part responds to #== 0 with true returns the result of sending #to_r to the real part
fails:Complex#to_r when the imaginary part is non-zero raises RangeError
fails:Complex#to_r when the imaginary part is Float 0.0 raises RangeError
1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/to_s_tags.txt
Original file line number Diff line number Diff line change
@@ -3,5 +3,4 @@ fails:Complex#to_s returns 1+0.0i for Complex(1, 0.0)
fails:Complex#to_s returns 1-0.0i for Complex(1, -0.0)
fails:Complex#to_s returns 1+Infinity*i for Complex(1, Infinity)
fails:Complex#to_s returns 1-Infinity*i for Complex(1, -Infinity)
fails:Complex#to_s returns 1+NaN*i for Complex(1, NaN)
fails:Complex#to_s when self's real component is 0 returns both the real and imaginary component even when the real is 0
1 change: 0 additions & 1 deletion spec/truffle/tags/core/complex/uminus_tags.txt

This file was deleted.

0 comments on commit ac9c832

Please sign in to comment.