gitlab.com/jokerrs1/Sia@v1.3.2/siatest/testhelpers.go (about) 1 package siatest 2 3 import "github.com/NebulousLabs/fastrand" 4 5 // Fuzz returns 0, 1 or -1. This can be used to test for random off-by-one 6 // errors in the code. For example fuzz can be used to create a File that is 7 // either sector aligned or off-by-one. 8 func Fuzz() int { 9 // Intn(3) creates a number of the set [0,1,2]. By subtracting 1 we end up 10 // with a number of the set [-1,0,1]. 11 return fastrand.Intn(3) - 1 12 }