diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-08 12:11:18 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-04-08 12:11:18 -0700 |
| commit | 87cd4c5ecc69208018c4d9deea63d566974561dd (patch) | |
| tree | 91e914936c38b23d35f4f7bc4694c78036a54363 /test/t/comparable.rb | |
| parent | 1b40c057f56ffa87abc7c5db467c91981db610f8 (diff) | |
| parent | 91db2904124c66ee44499a6f93ceb2e56a99642c (diff) | |
| download | mruby-87cd4c5ecc69208018c4d9deea63d566974561dd.tar.gz mruby-87cd4c5ecc69208018c4d9deea63d566974561dd.zip | |
Merge pull request #1144 from monaka/pr-add-iso-conformance-tests-20130406
Add more ISO conformance tests.
Diffstat (limited to 'test/t/comparable.rb')
| -rw-r--r-- | test/t/comparable.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/t/comparable.rb b/test/t/comparable.rb index c95134246..ab81fa3ed 100644 --- a/test/t/comparable.rb +++ b/test/t/comparable.rb @@ -54,3 +54,18 @@ assert('Comparable#>=', '15.3.3.2.5') do (Foo.new >= Foo.new) == true end +assert('Comparable#between?', '15.3.3.2.6') do + class Foo + include Comparable + def <=>(x) + x + end + end + + c = Foo.new + c.between?(-1, 1) == false && + c.between?(-1, -1) == false && + c.between?( 1, 1) == false && + c.between?( 1, -1) == true && + c.between?(0, 0) == true +end |
