Project

General

Profile

Actions

Misc #10809

closed

[PATCH 2/2] Add tests for math.c related to [Feature 10785], [Feature 10800]

Added by gogotanaka (Kazuki Tanaka) about 9 years ago. Updated about 9 years ago.


Description

Hi! Here are two patches.

reorder_test_cbrt_and_add_a_assertion.patch:

Move Test#test_cbrt to more proper place and add a assertion for Math.cbrt(1.0/0)

add_test_for_math_c_about_overriding_Integer_to_f.patch:

Add tests for Feature 10785 and Feature 10800

These two features are merged by Nobuyoshi Nakada san, so I assigned him but please feel free to reassigne.

thanks.


Files

reorder_test_cbrt_and_add_a_assertion.patch (1.19 KB) reorder_test_cbrt_and_add_a_assertion.patch gogotanaka (Kazuki Tanaka), 02/01/2015 12:23 AM
add_test_for_math_c_about_overriding_Integer_to_f.patch (1.36 KB) add_test_for_math_c_about_overriding_Integer_to_f.patch gogotanaka (Kazuki Tanaka), 02/01/2015 12:23 AM
use_assert_infinity.patch (2.53 KB) use_assert_infinity.patch gogotanaka (Kazuki Tanaka), 02/01/2015 04:39 AM
revert_to_original_methods.patch (1.1 KB) revert_to_original_methods.patch gogotanaka (Kazuki Tanaka), 02/01/2015 04:56 AM
add_test_about_overriding_Integer_to_f_20150222.patch (1.31 KB) add_test_about_overriding_Integer_to_f_20150222.patch gogotanaka (Kazuki Tanaka), 02/22/2015 01:01 AM

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

+    assert_equal(1.0/0, Math.cbrt(1.0/0))

Isn't it better to use assert_infinity?

+      def to_f
+        _to_f
+      end

Why not revert to the original methods?

Updated by gogotanaka (Kazuki Tanaka) about 9 years ago

Isn't it better to use assert_infinity?

It's much better! I attached patch to follow what you said(not only Math.cbrt also other cases)

Why not revert to the original methods?

I intended to revert to the original methods through this way.

thanks.

Updated by gogotanaka (Kazuki Tanaka) about 9 years ago

Oh.. I found editting message with uploading new file posts new message with duplicate contents.

We seem not to be able to upload more than 2 patches at one message.

Updated by nobu (Nobuyoshi Nakada) about 9 years ago

class_eval with a block form would be preferable to a string form in may cases.

Are you going to commit these patches by yourself?
If so, then ask matz, and follow the instruction CommitterHowto

Updated by gogotanaka (Kazuki Tanaka) about 9 years ago

It's my super great pleasure to be able to do that, I'm glad to and go to follow what you said.

But now I'm afraid of committing myself and I realize there'er much things I should know.

So it seems to take a while. Anyway I want to do so.

thanks.

Updated by matz (Yukihiro Matsumoto) about 9 years ago

Commit bit approved. Proceed to usual previledge grant process.

Matz.

Updated by gogotanaka (Kazuki Tanaka) about 9 years ago

I'll commit these 3 patches.

reorder_test_cbrt_and_add_a_assertion.patch:

Move Test#test_cbrt to more proper place and add a assertion for Math.cbrt(1.0/0)

use_assert_infinity.patch:

Use assert_infinity instead of assert_equal(1.0/0, ...)

add_test_about_overriding_Integer_to_f_20150222.patch:

Add tests for Feature 10785 and Feature 10800

Updated by gogotanaka (Kazuki Tanaka) about 9 years ago

  • Status changed from Open to Closed
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0