Chromium Code Reviews| Index: common/cmpbin/common_test.go |
| diff --git a/common/cmpbin/common_test.go b/common/cmpbin/common_test.go |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0ac00a943f4f7366a8e599ba67a82fbadc531b09 |
| --- /dev/null |
| +++ b/common/cmpbin/common_test.go |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package cmpbin |
| + |
| +import ( |
| + "flag" |
| + "fmt" |
| + "time" |
| +) |
| + |
| +var seed = flag.Int64("cmpbin.seed", time.Now().UnixNano(), "random seed for testing") |
| + |
| +var randomTestSize = 1000 |
| + |
| +func init() { |
| + flag.Parse() |
| + 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.
|
| +} |
| + |
| +type fakeWriter struct{ count int } |
| + |
| +func (f *fakeWriter) WriteByte(byte) error { |
| + if f.count == 0 { |
| + return fmt.Errorf("nope") |
| + } |
| + f.count-- |
| + return nil |
| +} |