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..00c36df1b4202211b70ac12bf3e5664cb41c2c23 |
| --- /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("test.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/06 23:21:34
Please remove
iannucci
2015/07/07 00:03:27
This is to enable randomized test failures to be r
|
| +} |
| + |
| +type fakeWriter struct{ count int } |
| + |
| +func (f *fakeWriter) WriteByte(byte) error { |
| + if f.count == 0 { |
| + return fmt.Errorf("nope") |
| + } |
| + f.count-- |
| + return nil |
| +} |