mirror of
https://github.com/golang/go
synced 2024-11-19 11:44:45 -07:00
28 lines
568 B
Go
28 lines
568 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")
|
||
|
}
|
||
|
}
|