-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
61 lines (59 loc) · 1.31 KB
/
main_test.go
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package main
// Example exercises the full package.
func Example() {
main()
// Output:
// investors [{i1 100 100} {i2 200 200} {i3 150 150} {i4 50 50}]
// loans [{l1 100 50} {l2 150 150} {l3 100 50} {l4 20 20} {l5 80 80} {l6 120 100}]
//
// loan &{l1 100 50}
// investor &{i1 100 100}
// loan < investor
// loan &{l1 100 0}
// investor &{i1 100 50}
//
// loan &{l2 150 150}
// investor &{i1 100 50}
// loan >= investor
// loan &{l2 150 100}
// investor &{i1 100 0}
//
// loan &{l2 150 100}
// investor &{i2 200 200}
// loan < investor
// loan &{l2 150 0}
// investor &{i2 200 100}
//
// loan &{l3 100 50}
// investor &{i2 200 100}
// loan < investor
// loan &{l3 100 0}
// investor &{i2 200 50}
//
// loan &{l4 20 20}
// investor &{i2 200 50}
// loan < investor
// loan &{l4 20 0}
// investor &{i2 200 30}
//
// loan &{l5 80 80}
// investor &{i2 200 30}
// loan >= investor
// loan &{l5 80 50}
// investor &{i2 200 0}
//
// loan &{l5 80 50}
// investor &{i3 150 150}
// loan < investor
// loan &{l5 80 0}
// investor &{i3 150 100}
//
// loan &{l6 120 100}
// investor &{i3 150 100}
// loan >= investor
// loan &{l6 120 0}
// investor &{i3 150 0}
//
// investors [{i1 100 0} {i2 200 0} {i3 150 0} {i4 50 50}]
// loans [{l1 100 0} {l2 150 0} {l3 100 0} {l4 20 0} {l5 80 0} {l6 120 0}]
}