aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_integer.rb
Commit message (Collapse)AuthorAgeFilesLines
* test_integer.rb: refine test_roundnobu2016-03-261-19/+29
| | | | | | | * test/ruby/test_integer.rb (test_round): refine assertions and borrow from rubyspec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (Bignum#even?, Bignum#odd?): remove definitionsmrkn2016-03-171-20/+0
| | | | | | | | | | | | | | | | because they are unified with Integer#even? and Integer#odd?. * numeric.c (Fixnum#zero?, Fixnum#even?, Fixnum#odd?): remove definitions because they are unified with Numeric#zero?, Integer#even?, and Integer#odd?. * numeric.c (num_zero_p, int_even_p, int_odd_p): treat Fixnum and Bignum values directly. * test/ruby/test_integer.rb (test_odd_p_even_p): remove meaningless test case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: better assertionsnobu2013-12-131-9/+9
| | | | | | * test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_bit_length): New method.akr2013-08-311-0/+36
| | | | | | | | | (rb_fix_bit_length): Ditto. [ruby-core:56247] [Feature #8700] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: add the prototype declaration ofmrkn2012-12-221-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rb_num_coerce_bit. * numeric.c (rb_num_coerce_bit): the new coerce function for bitwise binary operation. * bignum.c (rb_big_and): use coerce to convert the argument, which isn't a Fixnum nor a Bignum, to the corresponding Integer object so that bitwise operations can support Integer-mimic objects. [Bug #1792] [ruby-core:39491] * bignum.c (rb_big_or): ditto. * bignum.c (rb_big_xor): ditto. * numeric.c (bit_coerce): ditto. * numeric.c (fix_and): ditto. * numeric.c (fix_or): ditto. * numeric.c (fix_xor): ditto. * test/ruby/test_integer.rb: add tests for the above changes. * test/ruby/test_bignum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_str_to_inum): must be ASCII compatible encoding asnobu2012-03-231-0/+7
| | | | | | | well as String#hex and String#oct. [ruby-core:43566][Bug #6192] * string.c (rb_must_asciicompat): check if ASCII compatible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* supress warnings.akr2010-01-251-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb: add a test for Array#rotate, rotate!.mame2010-01-221-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * test/ruby/test_dir.rb, test/ruby/test_fnmatch.rb: add some tests (for coverage of dir.c). * test/ruby/test_enum.rb: add a test for Enumerable#minmax. * test/ruby/test_enumerator.rb: add some tests for Enumerator#inspect, Enumerator::Generator and Yielder. * test/ruby/test_env.rb: add a test for ENV#index. * test/ruby/test_exception.rb: add some tests (for coverage of error.c). * test/ruby/test_hash.rb: add a test for recursive check. * test/ruby/test_integer.rb: add a test for number of argument of Integer. * test/ruby/test_method.rb: add a test for define_method. * test/ruby/test_module.rb: add a test for constant of included module. * test/ruby/test_proc.rb: add a test for parameters with cfunc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * object.c (rb_f_integer): now Integer() takes optional basematz2009-10-031-0/+13
| | | | | | | | | | argument. base will be ignored for non string values. suggested by Sam Carr at RubyFoo Lounge at London. * test/ruby/test_integer.rb (TestInteger#test_Integer): test updated. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * prec.c: removed. Precision will be redesigned and be back again.yugui2008-09-191-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | c.f. [ruby-dev:36352]. * common.mk (COMMON_OBJS): removed prec.o. * inits.c (rb_call_inits): removed Init_Precision. * numeric.c (Init_Numeric): removed inclusion of Precision. removed #induced_from from each class. * rational.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * lib/rdoc/knwon_classes.rb: removed the entry for Precision. * test/ruby/test_prec.rb: removed. * test/ruby/test_integer.rb: removed tests for Precision. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_rational.rb: ditto. * test/ruby/test_complex.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_object.rb: new tests to achieve over 90% testmame2008-05-141-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | coverage of object.c, eval.c and eval_method.c. * test/ruby/test_module.rb: ditto. * test/ruby/test_trace.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_float.rb: ditto. * test/ruby/test_method.rb: ditto. * test/ruby/test_variable.rb: ditto. * test/ruby/test_eval.rb: ditto. * test/ruby/test_exception.rb: ditto. * test/ruby/test_class.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* split combinational blackbox tests.akr2008-05-011-607/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* 0**-1 test updated. [ruby-dev:34547]akr2008-04-301-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_pack.rb: fix tests for 64bit CPU.mame2008-02-101-4/+4
| | | | | | | | | | | | | | | | | * test/ruby/test_bignum.rb: ditto. * test/ruby/test_file_exhaustive.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_time.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_fixnum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_bignum.rb: suppress warnings during test.mame2008-01-311-0/+113
| | | | | | | | | | | | | | * test/ruby/test_enum.rb: ditto. * test/ruby/test_integer.rb: add tests to achieve over 90% test coverage of numeric.c. * test/ruby/test_float.rb: ditto. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_pack.rb: add tests to achieve over 90% test coverage of pack.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_integer.rb (test_Integer): multiple underscoresnobu2007-12-191-0/+1
| | | | | | | should not be allowed after octal prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_cstr_to_inum): an underscore succeeding after octalnobu2007-12-191-0/+3
| | | | | | | prefix is allowed. [ruby-core:14139] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_cstr_to_inum): trailing spaces may exist at sqeezingnobu2007-12-041-0/+3
| | | | | | | preceeding 0s. [ruby-core:13873] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test exceptions.akr2007-11-281-29/+41
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* more tests.akr2007-11-261-2/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_to_s refined.akr2007-11-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add more roundtrip tests.akr2007-11-251-0/+44
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for printf format %x, %o and %b.akr2007-11-241-0/+79
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14009 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bootstraptest/test_knownbug.rb: move solved tests.ko12007-11-231-0/+2
| | | | | | | | | | * bootstraptest/test_io.rb, test_marshal.rb, test_objectspace.rb: ditto. * test/ruby/test_integer.rb, test_regexp.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use ML ref. for assertion message.akr2007-11-181-5/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check class.akr2007-11-171-4/+56
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/ruby.h (struct RBignum): embed digits in RBignum forakr2007-09-011-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | small bignums. * bignum.c: RBignum embeded digits implemented. * include/ruby/intern.h: declare rb_big_resize. * gc.c: don't free embedded digits. * numeric.c: replace direct bignum field accessor by abstract field accessor such as RBIGNUM(val)->sign to RBIGNUM_SIGN(val). * sprintf.c: ditto. * compar.c: ditto. * marshal.c: ditto. * random.c: ditto. * .gdbinit: support embedded small bignums. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add assertions.akr2007-07-301-1/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_aref): check for Bignum index range.nobu2007-07-301-0/+7
| | | | | | | [ruby-dev:31271] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refine tests for shift.akr2007-07-191-7/+30
| | | | | | | more tests for string to integer conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_big_lshift, rb_big_rshift): separated functionsnobu2007-07-191-0/+19
| | | | | | | | | | to get rid of infinite recursion. fixed calculation in edge cases. [ruby-dev:31244] * numeric.c (rb_fix_lshift, rb_fix_rshift): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refine failure messages.akr2007-07-151-6/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * bignum.c (rb_cstr_to_inum): check leading non-digits.nobu2007-07-151-0/+12
| | | | | | | [ruby-core:11691] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refined.akr2007-07-151-5/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* more assertions.akr2007-07-141-2/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* refined.akr2007-07-131-16/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check values around 16bit.akr2007-07-131-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* more tests.akr2007-07-131-0/+30
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add assertions using equations taken from Hacker's Delight.akr2007-07-131-0/+15
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* new file.akr2007-07-131-0/+302
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e