mirror of
https://github.com/shopspring/decimal.git
synced 2024-11-22 20:40:48 +01:00
Add Equals test.
This commit is contained in:
parent
c6c99f4daa
commit
78186b90c0
1 changed files with 17 additions and 0 deletions
|
@ -477,6 +477,23 @@ func TestDecimal_Abs2(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestDecimal_Equal(t *testing.T) {
|
||||||
|
a := New(1234, 3)
|
||||||
|
b := New(1234, 3)
|
||||||
|
|
||||||
|
if !a.Equals(b) {
|
||||||
|
t.Errorf("Error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestDecimal_ScalesNotEqual(t *testing.T) {
|
||||||
|
a := New(1234, 2)
|
||||||
|
b := New(1234, 3)
|
||||||
|
if a.Equals(b) {
|
||||||
|
t.Errorf("Error")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func TestDecimal_Cmp1(t *testing.T) {
|
func TestDecimal_Cmp1(t *testing.T) {
|
||||||
a := New(123, 3)
|
a := New(123, 3)
|
||||||
b := New(-1234, 2)
|
b := New(-1234, 2)
|
||||||
|
|
Loading…
Reference in a new issue