From: Robert Griesemer Date: Fri, 22 May 2015 22:21:56 +0000 (-0700) Subject: cmd/compile/internal/big: update and apply vendor.bash X-Git-Tag: go1.5beta1~486 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1893d3b320887daeb0a088dc3067c45dd87d9d5b;p=gostls13.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 --- diff --git a/src/cmd/compile/internal/big/example_test.go b/src/cmd/compile/internal/big/example_test.go index 078be47f95..cb91bc23bd 100644 --- a/src/cmd/compile/internal/big/example_test.go +++ b/src/cmd/compile/internal/big/example_test.go @@ -5,9 +5,9 @@ package big_test import ( + "cmd/compile/internal/big" "fmt" "log" - "math/big" ) func ExampleRat_SetString() { diff --git a/src/cmd/compile/internal/big/floatexample_test.go b/src/cmd/compile/internal/big/floatexample_test.go index 7db10238bc..0ac9617c06 100644 --- a/src/cmd/compile/internal/big/floatexample_test.go +++ b/src/cmd/compile/internal/big/floatexample_test.go @@ -5,9 +5,9 @@ package big_test import ( + "cmd/compile/internal/big" "fmt" "math" - "math/big" ) func ExampleFloat_Add() { diff --git a/src/cmd/compile/internal/big/vendor.bash b/src/cmd/compile/internal/big/vendor.bash index 84aa750462..1b191ccb8f 100755 --- a/src/cmd/compile/internal/big/vendor.bash +++ b/src/cmd/compile/internal/big/vendor.bash @@ -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 .