mirror of
https://github.com/golang/go
synced 2024-11-18 22:55:23 -07:00
903a227b9b
Thanks to iant for identifying the root cause. Tested with go1.9 and go1.10. Fixes golang/go#25880 Change-Id: Ibc3a2aadd92c1e512cf6c537134ee085398e8e6c Reviewed-on: https://go-review.googlesource.com/118955 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
32 lines
661 B
Go
32 lines
661 B
Go
// Copyright 2018 The Go 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 static
|
|
|
|
import (
|
|
"bytes"
|
|
"io/ioutil"
|
|
"testing"
|
|
)
|
|
|
|
func TestStaticIsUpToDate(t *testing.T) {
|
|
oldBuf, err := ioutil.ReadFile("static.go")
|
|
if err != nil {
|
|
t.Errorf("error while reading static.go: %v\n", err)
|
|
}
|
|
|
|
newBuf, err := Generate()
|
|
if err != nil {
|
|
t.Errorf("error while generating static.go: %v\n", err)
|
|
}
|
|
|
|
if bytes.Compare(oldBuf, newBuf) != 0 {
|
|
t.Error(`static.go is stale. Run:
|
|
$ go generate golang.org/x/tools/godoc/static
|
|
$ git diff
|
|
to see the differences.`)
|
|
|
|
}
|
|
}
|