mirror of https://github.com/golang/go.git
cmd/compile/internal/big: update and apply vendor.bash
Package-external tests must use the vendored math/big package, not the original one, otherwise tests may fail if there are discrepancies in the implementation. Change-Id: Ic5f0489aa6420ffea1f488633453f871ce1f0f66 Reviewed-on: https://go-review.googlesource.com/10380 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
75250a9f79
commit
1893d3b320
|
|
@ -5,9 +5,9 @@
|
|||
package big_test
|
||||
|
||||
import (
|
||||
"cmd/compile/internal/big"
|
||||
"fmt"
|
||||
"log"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
func ExampleRat_SetString() {
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
package big_test
|
||||
|
||||
import (
|
||||
"cmd/compile/internal/big"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/big"
|
||||
)
|
||||
|
||||
func ExampleFloat_Add() {
|
||||
|
|
|
|||
|
|
@ -15,9 +15,15 @@ rm *.go
|
|||
cp $BIGDIR/*.go .
|
||||
|
||||
# Use pure Go arith ops w/o build tag.
|
||||
sed 's/^\/\/ \+build math_big_pure_go$//' arith_decl_pure.go > arith_decl.go
|
||||
sed 's|^// \+build math_big_pure_go$||' arith_decl_pure.go > arith_decl.go
|
||||
rm arith_decl_pure.go
|
||||
|
||||
# Import vendored math/big in external tests (e.g., floatexample_test.go).
|
||||
for f in *_test.go; do
|
||||
sed 's|"math/big"|"cmd/compile/internal/big"|' $f > foo.go
|
||||
mv foo.go $f
|
||||
done
|
||||
|
||||
# gofmt to clean up after sed
|
||||
gofmt -w .
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue