blob: 0fa0200df402753df9fb4c70bd82e50a9e288805 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# frozen_string_literal: true
require "cases/helper"
module ActiveModel
module Type
class BigIntegerTest < ActiveModel::TestCase
def test_type_cast_big_integer
type = Type::BigInteger.new
assert_equal 1, type.cast(1)
assert_equal 1, type.cast("1")
end
def test_small_values
type = Type::BigInteger.new
assert_equal(-9999999999999999999999999999999, type.serialize(-9999999999999999999999999999999))
end
def test_large_values
type = Type::BigInteger.new
assert_equal 9999999999999999999999999999999, type.serialize(9999999999999999999999999999999)
end
end
end
end
|