From 54d3d47daf9190275bbdaf8703b84969a4593451 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Fri, 24 Mar 2017 23:31:34 -0700 Subject: PLT-6076 Adding viper libs for config file changes (#5871) * Adding viper libs for config file changes * Removing the old fsnotify lib * updating some missing libs --- .../golang.org/x/text/internal/triegen/gen_test.go | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 vendor/golang.org/x/text/internal/triegen/gen_test.go (limited to 'vendor/golang.org/x/text/internal/triegen/gen_test.go') diff --git a/vendor/golang.org/x/text/internal/triegen/gen_test.go b/vendor/golang.org/x/text/internal/triegen/gen_test.go new file mode 100644 index 000000000..831627d7a --- /dev/null +++ b/vendor/golang.org/x/text/internal/triegen/gen_test.go @@ -0,0 +1,68 @@ +// Copyright 2014 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. + +// +build generate + +package triegen_test + +// The code in this file generates captures and writes the tries generated in +// the examples to data_test.go. To invoke it, run: +// go test -tags=generate +// +// Making the generation code a "test" allows us to link in the necessary test +// code. + +import ( + "log" + "os" + "os/exec" +) + +func init() { + const tmpfile = "tmpout" + const dstfile = "data_test.go" + + f, err := os.Create(tmpfile) + if err != nil { + log.Fatalf("Could not create output file: %v", err) + } + defer os.Remove(tmpfile) + defer f.Close() + + // We exit before this function returns, regardless of success or failure, + // so there's no need to save (and later restore) the existing genWriter + // value. + genWriter = f + + f.Write([]byte(header)) + + Example_build() + ExampleGen_build() + + if err := exec.Command("gofmt", "-w", tmpfile).Run(); err != nil { + log.Fatal(err) + } + os.Remove(dstfile) + os.Rename(tmpfile, dstfile) + + os.Exit(0) +} + +const header = `// This file is generated with "go test -tags generate". DO NOT EDIT! +// +build !generate + +package triegen_test +` + +// Stubs for generated tries. These are needed as we exclude data_test.go if +// the generate flag is set. This will clearly make the tests fail, but that +// is okay. It allows us to bootstrap. + +type trie struct{} + +func (t *trie) lookupString(string) (uint8, int) { return 0, 1 } +func (t *trie) lookupStringUnsafe(string) uint64 { return 0 } + +func newRandTrie(i int) *trie { return &trie{} } +func newMultiTrie(i int) *trie { return &trie{} } -- cgit v1.2.3-1-g7c22