66)
77
88func TestQuotient (t * testing.T ) {
9- var tests = []struct {
9+ tests : = []struct {
1010 Input [2 ]int64
1111 Output int64
1212 }{
@@ -23,7 +23,7 @@ func TestQuotient(t *testing.T) {
2323}
2424
2525func TestRemainder (t * testing.T ) {
26- var tests = []struct {
26+ tests : = []struct {
2727 Input [2 ]int64
2828 Output [2 ]int64
2929 }{
@@ -41,7 +41,7 @@ func TestRemainder(t *testing.T) {
4141}
4242
4343func TestInvert (t * testing.T ) {
44- var tests = []struct {
44+ tests : = []struct {
4545 Input [2 ]int64
4646 Output [2 ]int64
4747 }{
@@ -56,7 +56,7 @@ func TestInvert(t *testing.T) {
5656}
5757
5858func TestAdd (t * testing.T ) {
59- var tests = []struct {
59+ tests : = []struct {
6060 Input [4 ]int64
6161 Output [2 ]int64
6262 }{
@@ -75,7 +75,7 @@ func TestAdd(t *testing.T) {
7575}
7676
7777func TestSubtract (t * testing.T ) {
78- var tests = []struct {
78+ tests : = []struct {
7979 Input [4 ]int64
8080 Output [2 ]int64
8181 }{
@@ -94,7 +94,7 @@ func TestSubtract(t *testing.T) {
9494}
9595
9696func TestLessThan (t * testing.T ) {
97- var tests = []struct {
97+ tests : = []struct {
9898 Input [4 ]int64
9999 Output bool
100100 }{
@@ -112,7 +112,7 @@ func TestLessThan(t *testing.T) {
112112}
113113
114114func TestEqualTo (t * testing.T ) {
115- var tests = []struct {
115+ tests : = []struct {
116116 Input [4 ]int64
117117 Output bool
118118 }{
@@ -131,7 +131,7 @@ func TestEqualTo(t *testing.T) {
131131}
132132
133133func TestGreaterThan (t * testing.T ) {
134- var tests = []struct {
134+ tests : = []struct {
135135 Input [4 ]int64
136136 Output bool
137137 }{
@@ -151,7 +151,7 @@ func TestGreaterThan(t *testing.T) {
151151}
152152
153153func TestMultiply (t * testing.T ) {
154- var tests = []struct {
154+ tests : = []struct {
155155 Input [4 ]int64
156156 Output [2 ]int64
157157 }{
@@ -171,7 +171,7 @@ func TestMultiply(t *testing.T) {
171171}
172172
173173func TestDivide (t * testing.T ) {
174- var tests = []struct {
174+ tests : = []struct {
175175 Input [4 ]int64
176176 Output [2 ]int64
177177 }{
@@ -192,7 +192,7 @@ func TestDivide(t *testing.T) {
192192}
193193
194194func TestToSignificant (t * testing.T ) {
195- var tests = []struct {
195+ tests : = []struct {
196196 Input [2 ]int64
197197 Output string
198198 Format uint
@@ -203,6 +203,7 @@ func TestToSignificant(t *testing.T) {
203203 {[2 ]int64 {126 , 100 }, "1.26" , 2 },
204204 {[2 ]int64 {124 , 100 }, "1.2" , 1 },
205205 {[2 ]int64 {124 , 100 }, "1.24" , 2 },
206+ {[2 ]int64 {125 , 1000000000 }, "0.00000013" , 2 },
206207 }
207208 for i , test := range tests {
208209 output := NewFraction (big .NewInt (test .Input [0 ]), big .NewInt (test .Input [1 ])).ToSignificant (test .Format )
0 commit comments