File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ package otr3
2
+
3
+ import (
4
+ "math/big"
5
+ "testing"
6
+ )
7
+
8
+ func Test_mod_returnsTheValueModAnotherValue (t * testing.T ) {
9
+ result := mod (big .NewInt (7 ), big .NewInt (3 ))
10
+ assertDeepEquals (t , result , big .NewInt (1 ))
11
+ }
12
+
13
+ func Test_lt_returnsTrueIfTheLeftIsSmallerThanTheRight (t * testing.T ) {
14
+ assertDeepEquals (t , lt (big .NewInt (3 ), big .NewInt (7 )), true )
15
+ assertDeepEquals (t , lt (big .NewInt (6 ), big .NewInt (7 )), true )
16
+ assertDeepEquals (t , lt (big .NewInt (7 ), big .NewInt (7 )), false )
17
+ assertDeepEquals (t , lt (big .NewInt (8 ), big .NewInt (7 )), false )
18
+ }
19
+
20
+ func Test_gt_returnsTrueIfTheLeftIsGreaterThanTheRight (t * testing.T ) {
21
+ assertDeepEquals (t , gt (big .NewInt (3 ), big .NewInt (3 )), false )
22
+ assertDeepEquals (t , gt (big .NewInt (4 ), big .NewInt (3 )), true )
23
+ assertDeepEquals (t , gt (big .NewInt (7 ), big .NewInt (3 )), true )
24
+ }
You can’t perform that action at this time.
0 commit comments