]>
git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/ruby/red-arrow/test/test-decimal256.rb
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
18 class Decimal256Test
< Test
::Unit::TestCase
19 sub_test_case("instance methods") do
21 @decimal256 = Arrow
::Decimal256.new("10.1")
24 sub_test_case("#==") do
25 test("Arrow::Decimal256") do
27 @decimal256 == @decimal256
31 test("not Arrow::Decimal256") do
33 not (@decimal256 == 10.1)
38 sub_test_case("#!=") do
39 test("Arrow::Decimal256") do
41 not (@decimal256 != @decimal256)
45 test("not Arrow::Decimal256") do
52 sub_test_case("#to_s") do
65 decimal256
= Arrow
::Decimal256.new("-10.1")
67 Arrow
::Decimal256.new("-10.1"),
68 Arrow
::Decimal256.new("10.1"),
77 decimal256
= Arrow
::Decimal256.new("-10.1")
79 assert_equal(Arrow
::Decimal256.new("10.1"),
84 decimal256
= Arrow
::Decimal256.new("-10.1")
86 Arrow
::Decimal256.new("-10.1"),
87 Arrow
::Decimal256.new("10.1"),
96 decimal256
= Arrow
::Decimal256.new("-10.1")
98 assert_equal(Arrow
::Decimal256.new("10.1"),