aboutsummaryrefslogtreecommitdiff
path: root/client/bid_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/bid_test.go')
-rw-r--r--client/bid_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/client/bid_test.go b/client/bid_test.go
new file mode 100644
index 0000000..52c4c3c
--- /dev/null
+++ b/client/bid_test.go
@@ -0,0 +1,27 @@
+package client
+
+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)
+} \ No newline at end of file