Skip to content
Permalink
Browse files

Merge 7f0f4e7 into 9fd5e51

  • Loading branch information
alex committed Jul 25, 2014
2 parents 9fd5e51 + 7f0f4e7 commit 98e3d62eec21b7b573245a7cd734b78b8508b4fa
@@ -4,7 +4,7 @@


def pytest_funcarg__space(request):
# Inside the function so various intitialization stuff isn't seen until
# Inside the function so various initialization stuff isn't seen until
# coverage is setup.
import topaz
from topaz.main import get_topaz_config_options
@@ -69,7 +69,7 @@ def test_new_simple(self, space, tmpdir):
with self.raises(space, "ArgumentError", "invalid access mode ra"):
space.execute("File.new('%s', 'ra')" % f)
with self.raises(space, "Errno::ENOENT"):
space.execute("File.new('%s', 1)" % tmpdir.join("non-existant"))
space.execute("File.new('%s', 1)" % tmpdir.join("non-existent"))

w_res = space.execute("return File.new('%s%snonexist', 'w')" % (tmpdir.dirname, os.sep))
assert isinstance(w_res, W_FileObject)
@@ -48,7 +48,7 @@ class MSpecScript
"^#{Rubyspec}/language/predefined_spec.rb",
# AttributeError: 'File' object has no attribute 'compile_defined'
"^#{Rubyspec}/language/defined_spec.rb",
# no real reason found (results in a Aborted (core dumped))
# no real reason found (results in an Aborted (core dumped))
# AssertionError in Parser_combine_send_block ?
"^#{Rubyspec}/language/return_spec.rb",
# command_asgn_lhs_equal_command_asgn
@@ -92,7 +92,7 @@ def handle_bytecode(self, space, pc, frame, bytecode):
def run_instr(self, space, name, num_args, bytecode, frame, pc):
args = ()
# Do not change these from * 256 to << 8, lshift has defined overflow
# semantics which cause it to not propogate the nonnegative-ness.
# semantics which cause it to not propagate the nonnegative-ness.
if num_args >= 1:
v = ord(bytecode.code[pc]) | (ord(bytecode.code[pc + 1]) * 256)
check_nonneg(v)
@@ -182,7 +182,7 @@ def method_divmod(self, space, w_other):
space.is_kind_of(w_other, space.w_fixnum)):
other = space.bigint_w(w_other)
if not other.tobool():
raise space.error(space.w_ZeroDivisionError, "devided by 0")
raise space.error(space.w_ZeroDivisionError, "divided by 0")
div, mod = self.bigint.divmod(other)
return space.newarray([space.newbigint_fromrbigint(div),
space.newbigint_fromrbigint(mod)])
@@ -220,5 +220,5 @@ def method_mod(self, space, w_other):

def method_mod_bigint_impl(self, space, other):
if not other.tobool():
raise space.error(space.w_ZeroDivisionError, "devided by 0")
raise space.error(space.w_ZeroDivisionError, "divided by 0")
return space.newbigint_fromrbigint(self.bigint.mod(other))
@@ -340,7 +340,7 @@ def method_mod(self, space, w_other):

def method_mod_float_impl(self, space, other):
if other == 0.0:
raise space.error(space.w_ZeroDivisionError, "devided by 0")
raise space.error(space.w_ZeroDivisionError, "divided by 0")
elif self.floatvalue == -0.0:
return space.newfloat(-0.0)
elif math.isinf(other) and other < 0.0:
@@ -230,7 +230,7 @@ def method_divmod(self, space, w_other):
if y == 0:
raise space.error(
space.w_ZeroDivisionError,
"devided by 0"
"divided by 0"
)
mod = space.int_w(self.method_mod_int_impl(space, y))
div = (self.intvalue - mod) / y
@@ -262,7 +262,7 @@ def method_mod(self, space, w_other):

def method_mod_int_impl(self, space, other):
if other == 0:
raise space.error(space.w_ZeroDivisionError, "devided by 0")
raise space.error(space.w_ZeroDivisionError, "divided by 0")
return space.newint(self.intvalue % other)

@classdef.method("<<", other="int")

0 comments on commit 98e3d62

Please sign in to comment.
You can’t perform that action at this time.