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 "errors" |
| 9 "flag" |
| 10 "log" |
| 11 "time" |
| 12 ) |
| 13 |
| 14 var seed = flag.Int64("cmpbin.seed", time.Now().UnixNano(), "random seed for tes
ting") |
| 15 |
| 16 var randomTestSize = 1000 |
| 17 |
| 18 func init() { |
| 19 flag.Parse() |
| 20 log.Println("cmpbin.seed =", *seed) |
| 21 } |
| 22 |
| 23 type fakeWriter struct{ count int } |
| 24 |
| 25 func (f *fakeWriter) WriteByte(byte) error { |
| 26 if f.count == 0 { |
| 27 return errors.New("nope") |
| 28 } |
| 29 f.count-- |
| 30 return nil |
| 31 } |
OLD | NEW |