diff options
author | Jan Mercl <0xjnml@gmail.com> | 2020-08-26 23:31:54 +0200 |
---|---|---|
committer | Jan Mercl <0xjnml@gmail.com> | 2020-08-26 23:31:54 +0200 |
commit | e662a135d139be00d9539517df0976318adbdfa1 (patch) | |
tree | a3f39f3ad0b653020dbd24f23ca5e32ac86fce3b /internal/libc2/all_test.go | |
parent | 43c865ce5d35eb463e4a05f65e8e388364480711 (diff) |
release 1.4.0v1.4.0
Diffstat (limited to 'internal/libc2/all_test.go')
-rw-r--r-- | internal/libc2/all_test.go | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/internal/libc2/all_test.go b/internal/libc2/all_test.go new file mode 100644 index 0000000..5842011 --- /dev/null +++ b/internal/libc2/all_test.go @@ -0,0 +1,56 @@ +// Copyright 2019 The Sqlite 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 libc2 // import "modernc.org/sqlite/internal/libc2" + +import ( + "fmt" + "os" + "path" + "runtime" + "strings" + "testing" +) + +func caller(s string, va ...interface{}) { + if s == "" { + s = strings.Repeat("%v ", len(va)) + } + _, fn, fl, _ := runtime.Caller(2) + fmt.Fprintf(os.Stderr, "# caller: %s:%d: ", path.Base(fn), fl) + fmt.Fprintf(os.Stderr, s, va...) + fmt.Fprintln(os.Stderr) + _, fn, fl, _ = runtime.Caller(1) + fmt.Fprintf(os.Stderr, "# \tcallee: %s:%d: ", path.Base(fn), fl) + fmt.Fprintln(os.Stderr) + os.Stderr.Sync() +} + +func dbg(s string, va ...interface{}) { + if s == "" { + s = strings.Repeat("%v ", len(va)) + } + _, fn, fl, _ := runtime.Caller(1) + fmt.Fprintf(os.Stderr, "# dbg %s:%d: ", path.Base(fn), fl) + fmt.Fprintf(os.Stderr, s, va...) + fmt.Fprintln(os.Stderr) + os.Stderr.Sync() +} + +func TODO(...interface{}) string { //TODOOK + _, fn, fl, _ := runtime.Caller(1) + return fmt.Sprintf("# TODO: %s:%d:\n", path.Base(fn), fl) //TODOOK +} + +func use(...interface{}) {} + +func init() { + use(caller, dbg, TODO) //TODOOK +} + +// ============================================================================ + +func Test(t *testing.T) { + t.Log("TODO") +} |