blob: a479e5d7d9b6f95aeaac5db4cd1b2e167f11da49 (
plain)
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
|
package bidder
import (
"testing"
)
func TestBitlengthTooLarge(t *testing.T) {
bid, e := newBid(0xFFFFFF, 70)
if e == nil {
t.Fatalf("failure expected, but got bid: %#v", bid)
}
}
func TestPriceTooLarge(t *testing.T) {
bid, e := newBid(0xFFFFFF, 8)
if e == nil {
t.Fatalf("failure expected, but got bid: %#v", bid)
}
}
func TestBidOK(t *testing.T) {
bid, e := newBid(102400, 24)
if e != nil {
t.Fatalf("unexpected error: %v", e)
}
t.Logf("Bid: %+v", bid)
}
|