Skip to content

Commit

Permalink
squashme
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Dec 29, 2022
1 parent 75ee903 commit 8114d9a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package uint256

import (
"errors"
"fmt"
"math/big"
"testing"
Expand All @@ -17,15 +16,13 @@ func testSetFromDec(tc string) error {
err := a.SetFromDecimal(tc)
{ // Check the FromDecimal too
b, err2 := FromDecimal(tc)
switch {
case a == nil && b != nil:
return errors.New("a != b")
case a != nil && b == nil:
return errors.New("a != b")
case err != nil && err2 == nil:
return errors.New("err != err2")
case err == nil && err2 != nil:
return errors.New("err != err2")
if (err == nil) != (err2 == nil) {
return fmt.Errorf("err != err2: %v %v", err, err2)
}
if err == nil {
if a.Cmp(b) != 0 {
fmt.Errorf("a != b: %v %v", a, b)
}
}
}
// If input is negative, we should eror
Expand Down

0 comments on commit 8114d9a

Please sign in to comment.