OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 package cmpbin | |
6 | |
7 import ( | |
8 "flag" | |
9 "fmt" | |
10 "time" | |
11 ) | |
12 | |
13 var seed = flag.Int64("cmpbin.seed", time.Now().UnixNano(), "random seed for tes ting") | |
14 | |
15 var randomTestSize = 1000 | |
16 | |
17 func init() { | |
18 flag.Parse() | |
19 fmt.Println("cmpbin.seed =", *seed) | |
M-A Ruel
2015/07/07 16:41:40
I'd prefer log instead of fmt.
iannucci
2015/07/07 18:37:37
Done.
| |
20 } | |
21 | |
22 type fakeWriter struct{ count int } | |
23 | |
24 func (f *fakeWriter) WriteByte(byte) error { | |
25 if f.count == 0 { | |
26 return fmt.Errorf("nope") | |
27 } | |
28 f.count-- | |
29 return nil | |
30 } | |
OLD | NEW |