general: remove junk files
Change-Id: Ia7ca1aafe682b44baab3aa60e3b09ddba6c1c281
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/8405
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/genpkgtests.go b/genpkgtests.go
deleted file mode 100644
index 676bc32..0000000
--- a/genpkgtests.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// +build ignore
-
-package main
-
-import (
- "fmt"
- "go/ast"
- "go/parser"
- "go/token"
- "io/ioutil"
- "os"
-
- "strconv"
-
- "github.com/rogpeppe/go-internal/txtar"
-)
-
-func main() {
- fset := token.NewFileSet()
- f, err := parser.ParseFile(fset, "./cue/builtin_test.go", nil, 0)
- if err != nil {
- fmt.Println(err)
- return
- }
-
- m := map[string]*txtar.Archive{}
- count := map[string]int{}
-
- ast.Inspect(f, func(n ast.Node) bool {
- call, ok := n.(*ast.CallExpr)
- if !ok {
- return true
- }
- ident, ok := call.Fun.(*ast.Ident)
- if !ok || ident.Name != "test" {
- return true
- }
-
- str := call.Args[0].(*ast.BasicLit)
- pkg, _ := strconv.Unquote(str.Value)
- a := &txtar.Archive{
- Comment: []byte(
- "# generated from the original tests.\n# Henceforth it may be nicer to group tests into separate files."),
- Files: []txtar.File{{Name: "in.cue"}},
- }
- m[pkg] = a
- return false
- })
-
- ast.Inspect(f, func(n ast.Node) bool {
- call, ok := n.(*ast.CallExpr)
- if !ok {
- return true
- }
- ident, ok := call.Fun.(*ast.Ident)
- if !ok || ident.Name != "test" {
- return true
- }
-
- str := call.Args[0].(*ast.BasicLit)
- pkg, _ := strconv.Unquote(str.Value)
- str = call.Args[1].(*ast.BasicLit)
- expr, err := strconv.Unquote(str.Value)
- if err != nil {
- panic(err)
- }
-
- a := m[pkg]
- count[pkg]++
-
- a.Files[0].Data = append(a.Files[0].Data,
- fmt.Sprintf("t%d: %s\n", count[pkg], expr)...)
-
- return false
- })
-
- for key, a := range m {
- os.Mkdir(fmt.Sprintf("pkg/%s/testdata", key), 0755)
- p := fmt.Sprintf("pkg/%s/testdata/gen.txtar", key)
- ioutil.WriteFile(p, txtar.Format(a), 0644)
- }
-}
diff --git a/tmp.cue b/tmp.cue
deleted file mode 100644
index e69de29..0000000
--- a/tmp.cue
+++ /dev/null