Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyoichiro Yamada committed Aug 3, 2019
1 parent d8da32b commit 5193bb0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions editor/test/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
var Assets = goblet.NewFS(
map[string][]string{},
map[string]*goblet.File{
"/sample/out_colored.txt": goblet.NewFile("/sample/out_colored.txt", _Assets64295af663b532b72d17cd22db298a3d276a5583, 0x1a4, time.Unix(1549785466, 1549785466313303941)),
"/sample/out_colored.txt": goblet.NewFile("/sample/out_colored.txt", _Assets64295af663b532b72d17cd22db298a3d276a5583, 0x1a4, time.Unix(1564845186, 1564845186462872869)),
"/sample/out_raw.txt": goblet.NewFile("/sample/out_raw.txt", _Assetsed805497a9c9001c8e8baf583bfdc6893d5fe8f6, 0x1a4, time.Unix(1549785466, 1549785466313613757)),
},
)

// binary data
var (
_Assets64295af663b532b72d17cd22db298a3d276a5583 = []byte("\x1b[33m\x1b[1mBUILD| github.com/kyoh86/richgo/sample/buildfail\x1b[0m\n\x1b[33m\x1b[1m | \x1b[36msample/buildfail/buildfail_test.go\x1b[0m:\x1b[35m6\x1b[0m:10: t.Foo undefined (type *testing.T has no field or method Foo)\x1b[0m\n\x1b[90mSTART| SampleNG\x1b[0m\n\x1b[90mSTART| SampleNG/SubtestNG\x1b[0m\n\x1b[31m\x1b[1mFAIL | --- FAIL: Test\x1b[0mSampleNG (0.00s)\n\x1b[31m\x1b[1m | \t\x1b[36msample_ng_test.go\x1b[0m:\x1b[35m9\x1b[0m: It's not OK... :(\x1b[0m\n\x1b[31m\x1b[1mFAIL | --- FAIL: Test\x1b[0mSampleNG/SubtestNG (0.00s)\n\x1b[31m\x1b[1m | \t\x1b[36msample_ng_test.go\x1b[0m:\x1b[35m13\x1b[0m: It's also not OK... :(\x1b[0m\n\x1b[90mSTART| SampleOK\x1b[0m\n\x1b[90mSTART| SampleOK/SubtestOK\x1b[0m\n\x1b[90m | time:2017-01-01T01:01:01+09:00\x1b[0m\n\x1b[32mPASS | \x1b[0mSampleOK (0.00s)\n\x1b[32m | \t\x1b[36msample_ok_test.go\x1b[0m:\x1b[35m11\x1b[0m: It's OK!\x1b[0m\n\x1b[32mPASS | \x1b[0mSampleOK/SubtestOK (0.00s)\n\x1b[32m | \t\x1b[36msample_ok_test.go\x1b[0m:\x1b[35m15\x1b[0m: It's also OK!\x1b[0m\n\x1b[90mSTART| SampleSkip\x1b[0m\n\x1b[90mSKIP | \x1b[0mSampleSkip (0.00s)\n\x1b[90m | \t\x1b[36msample_skip_test.go\x1b[0m:\x1b[35m6\x1b[0m: \x1b[0m\n\x1b[90mSTART| SampleSkipSub\x1b[0m\n\x1b[90mSTART| SampleSkipSub/SubtestSkip\x1b[0m\n\x1b[32mPASS | \x1b[0mSampleSkipSub (0.00s)\n\x1b[90mSKIP | \x1b[0mSampleSkipSub/SubtestSkip (0.00s)\n\x1b[90m | \t\x1b[36msample_skip_test.go\x1b[0m:\x1b[35m11\x1b[0m: \x1b[0m\n\x1b[90mSTART| SampleTimeout\x1b[0m\n\x1b[90mSTART| SampleTimeout/SubtestTimeout\x1b[0m\n\x1b[32mPASS | \x1b[0mSampleTimeout (3.00s)\n\x1b[32mPASS | \x1b[0mSampleTimeout/SubtestTimeout (3.00s)\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[31m\x1b[1mFAIL | \tgithub.com/kyoh86/richgo/sample\t3.014s\x1b[0m\n\x1b[31m\x1b[1mFAIL | \tgithub.com/kyoh86/richgo/sample/buildfail [build failed]\x1b[0m\n\x1b[90mSTART| Cover05\x1b[0m\n\x1b[32mPASS | \x1b[0mCover05 (0.00s)\n\x1b[32mCOVER| 50.0% [#####_____]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/cover05 0.015s\x1b[0m\n\x1b[32mCOVER| 50.0% [#####_____]\x1b[0m\n\x1b[90mSTART| CoverAll\x1b[0m\n\x1b[32mPASS | \x1b[0mCoverAll (0.00s)\n\x1b[32mCOVER| 100.0% [##########]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/coverall 0.008s\x1b[0m\n\x1b[32mCOVER| 100.0% [##########]\x1b[0m\n\x1b[32m | testing: warning: no tests to run\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/emptytest 0.013s\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[90mSTART| Nocover\x1b[0m\n\x1b[32mPASS | \x1b[0mNocover (0.00s)\n\x1b[32m | \t\x1b[36mnocover_test.go\x1b[0m:\x1b[35m6\x1b[0m: accept\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/nocover 0.007s\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[90mSKIP | github.com/kyoh86/richgo/sample/notest\t[no test files]\x1b[0m\n")
_Assets64295af663b532b72d17cd22db298a3d276a5583 = []byte("\x1b[33m\x1b[1mBUILD| github.com/kyoh86/richgo/sample/buildfail\x1b[0m\n\x1b[33m\x1b[1m | \x1b[36msample/buildfail/buildfail_test.go\x1b[0m:\x1b[35m6\x1b[0m:10: t.Foo undefined (type *testing.T has no field or method Foo)\x1b[0m\n\x1b[90mSTART| SampleNG\x1b[0m\n\x1b[90mSTART| SampleNG/SubtestNG\x1b[0m\n\x1b[31m\x1b[1mFAIL | SampleNG (0.00s)\x1b[0m\n\x1b[31m\x1b[1m | \t\x1b[36msample_ng_test.go\x1b[0m:\x1b[35m9\x1b[0m: It's not OK... :(\x1b[0m\n\x1b[31m\x1b[1mFAIL | SampleNG/SubtestNG (0.00s)\x1b[0m\n\x1b[31m\x1b[1m | \t\x1b[36msample_ng_test.go\x1b[0m:\x1b[35m13\x1b[0m: It's also not OK... :(\x1b[0m\n\x1b[90mSTART| SampleOK\x1b[0m\n\x1b[90mSTART| SampleOK/SubtestOK\x1b[0m\n\x1b[90m | time:2017-01-01T01:01:01+09:00\x1b[0m\n\x1b[32mPASS | SampleOK (0.00s)\x1b[0m\n\x1b[32m | \t\x1b[36msample_ok_test.go\x1b[0m:\x1b[35m11\x1b[0m: It's OK!\x1b[0m\n\x1b[32mPASS | SampleOK/SubtestOK (0.00s)\x1b[0m\n\x1b[32m | \t\x1b[36msample_ok_test.go\x1b[0m:\x1b[35m15\x1b[0m: It's also OK!\x1b[0m\n\x1b[90mSTART| SampleSkip\x1b[0m\n\x1b[90mSKIP | SampleSkip (0.00s)\x1b[0m\n\x1b[90m | \t\x1b[36msample_skip_test.go\x1b[0m:\x1b[35m6\x1b[0m: \x1b[0m\n\x1b[90mSTART| SampleSkipSub\x1b[0m\n\x1b[90mSTART| SampleSkipSub/SubtestSkip\x1b[0m\n\x1b[32mPASS | SampleSkipSub (0.00s)\x1b[0m\n\x1b[90mSKIP | SampleSkipSub/SubtestSkip (0.00s)\x1b[0m\n\x1b[90m | \t\x1b[36msample_skip_test.go\x1b[0m:\x1b[35m11\x1b[0m: \x1b[0m\n\x1b[90mSTART| SampleTimeout\x1b[0m\n\x1b[90mSTART| SampleTimeout/SubtestTimeout\x1b[0m\n\x1b[32mPASS | SampleTimeout (3.00s)\x1b[0m\n\x1b[32mPASS | SampleTimeout/SubtestTimeout (3.00s)\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[31m\x1b[1mFAIL | \tgithub.com/kyoh86/richgo/sample\t3.014s\x1b[0m\n\x1b[31m\x1b[1mFAIL | \tgithub.com/kyoh86/richgo/sample/buildfail [build failed]\x1b[0m\n\x1b[90mSTART| Cover05\x1b[0m\n\x1b[32mPASS | Cover05 (0.00s)\x1b[0m\n\x1b[32mCOVER| 50.0% [#####_____]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/cover05 0.015s\x1b[0m\n\x1b[32mCOVER| 50.0% [#####_____]\x1b[0m\n\x1b[90mSTART| CoverAll\x1b[0m\n\x1b[32mPASS | CoverAll (0.00s)\x1b[0m\n\x1b[32mCOVER| 100.0% [##########]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/coverall 0.008s\x1b[0m\n\x1b[32mCOVER| 100.0% [##########]\x1b[0m\n\x1b[32m | testing: warning: no tests to run\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/emptytest 0.013s\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[90mSTART| Nocover\x1b[0m\n\x1b[32mPASS | Nocover (0.00s)\x1b[0m\n\x1b[32m | \t\x1b[36mnocover_test.go\x1b[0m:\x1b[35m6\x1b[0m: accept\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[32mPASS | github.com/kyoh86/richgo/sample/nocover 0.007s\x1b[0m\n\x1b[33m\x1b[1mCOVER| 0.0% [__________]\x1b[0m\n\x1b[90mSKIP | github.com/kyoh86/richgo/sample/notest\t[no test files]\x1b[0m\n")
_Assetsed805497a9c9001c8e8baf583bfdc6893d5fe8f6 = []byte("# github.com/kyoh86/richgo/sample/buildfail\nsample/buildfail/buildfail_test.go:6:10: t.Foo undefined (type *testing.T has no field or method Foo)\n=== RUN TestSampleNG\n=== RUN TestSampleNG/SubtestNG\n--- FAIL: TestSampleNG (0.00s)\n\tsample_ng_test.go:9: It's not OK... :(\n --- FAIL: TestSampleNG/SubtestNG (0.00s)\n \tsample_ng_test.go:13: It's also not OK... :(\n=== RUN TestSampleOK\n=== RUN TestSampleOK/SubtestOK\ntime:2017-01-01T01:01:01+09:00\n--- PASS: TestSampleOK (0.00s)\n\tsample_ok_test.go:11: It's OK!\n --- PASS: TestSampleOK/SubtestOK (0.00s)\n \tsample_ok_test.go:15: It's also OK!\n=== RUN TestSampleSkip\n--- SKIP: TestSampleSkip (0.00s)\n\tsample_skip_test.go:6: \n=== RUN TestSampleSkipSub\n=== RUN TestSampleSkipSub/SubtestSkip\n--- PASS: TestSampleSkipSub (0.00s)\n --- SKIP: TestSampleSkipSub/SubtestSkip (0.00s)\n \tsample_skip_test.go:11: \n=== RUN TestSampleTimeout\n=== RUN TestSampleTimeout/SubtestTimeout\n--- PASS: TestSampleTimeout (3.00s)\n --- PASS: TestSampleTimeout/SubtestTimeout (3.00s)\nFAIL\ncoverage: 0.0% of statements\nFAIL\tgithub.com/kyoh86/richgo/sample\t3.014s\nFAIL\tgithub.com/kyoh86/richgo/sample/buildfail [build failed]\n=== RUN TestCover05\n--- PASS: TestCover05 (0.00s)\nPASS\ncoverage: 50.0% of statements\nok \tgithub.com/kyoh86/richgo/sample/cover05\t0.015s\tcoverage: 50.0% of statements\n=== RUN TestCoverAll\n--- PASS: TestCoverAll (0.00s)\nPASS\ncoverage: 100.0% of statements\nok \tgithub.com/kyoh86/richgo/sample/coverall\t0.008s\tcoverage: 100.0% of statements\ntesting: warning: no tests to run\nPASS\ncoverage: 0.0% of statements\nok \tgithub.com/kyoh86/richgo/sample/emptytest\t0.013s\tcoverage: 0.0% of statements [no tests to run]\n=== RUN TestNocover\n--- PASS: TestNocover (0.00s)\n\tnocover_test.go:6: accept\nPASS\ncoverage: 0.0% of statements\nok \tgithub.com/kyoh86/richgo/sample/nocover\t0.007s\tcoverage: 0.0% of statements\n? \tgithub.com/kyoh86/richgo/sample/notest\t[no test files]\n")
)
3 changes: 3 additions & 0 deletions editor/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func (e *test) Edit(line string) (string, error) {
editor.RegexRepl{
Exp: passtail,
Func: func(s string) string {
s = strings.TrimLeft(s, " ")
if *config.C.LeaveTestPrefix {
s = strings.TrimPrefix(s, `--- PASS: `)
} else {
Expand All @@ -101,6 +102,7 @@ func (e *test) Edit(line string) (string, error) {
editor.RegexRepl{
Exp: failtail,
Func: func(s string) string {
s = strings.TrimLeft(s, " ")
if *config.C.LeaveTestPrefix {
s = strings.TrimPrefix(s, `--- FAIL: `)
} else {
Expand All @@ -115,6 +117,7 @@ func (e *test) Edit(line string) (string, error) {
editor.RegexRepl{
Exp: skiptail,
Func: func(s string) string {
s = strings.TrimLeft(s, " ")
if *config.C.LeaveTestPrefix {
s = strings.TrimPrefix(s, `--- SKIP: `)
} else {
Expand Down
24 changes: 12 additions & 12 deletions sample/out_colored.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,39 @@
 | sample/buildfail/buildfail_test.go:6:10: t.Foo undefined (type *testing.T has no field or method Foo)
START| SampleNG
START| SampleNG/SubtestNG
FAIL | --- FAIL: TestSampleNG (0.00s)
FAIL | SampleNG (0.00s)
 | sample_ng_test.go:9: It's not OK... :(
FAIL | --- FAIL: TestSampleNG/SubtestNG (0.00s)
FAIL | SampleNG/SubtestNG (0.00s)
 | sample_ng_test.go:13: It's also not OK... :(
START| SampleOK
START| SampleOK/SubtestOK
 | time:2017-01-01T01:01:01+09:00
PASS | SampleOK (0.00s)
PASS | SampleOK (0.00s)
 | sample_ok_test.go:11: It's OK!
PASS | SampleOK/SubtestOK (0.00s)
PASS | SampleOK/SubtestOK (0.00s)
 | sample_ok_test.go:15: It's also OK!
START| SampleSkip
SKIP | SampleSkip (0.00s)
SKIP | SampleSkip (0.00s)
 | sample_skip_test.go:6: 
START| SampleSkipSub
START| SampleSkipSub/SubtestSkip
PASS | SampleSkipSub (0.00s)
SKIP | SampleSkipSub/SubtestSkip (0.00s)
PASS | SampleSkipSub (0.00s)
SKIP | SampleSkipSub/SubtestSkip (0.00s)
 | sample_skip_test.go:11: 
START| SampleTimeout
START| SampleTimeout/SubtestTimeout
PASS | SampleTimeout (3.00s)
PASS | SampleTimeout/SubtestTimeout (3.00s)
PASS | SampleTimeout (3.00s)
PASS | SampleTimeout/SubtestTimeout (3.00s)
COVER| 0.0% [__________]
FAIL | github.com/kyoh86/richgo/sample 3.014s
FAIL | github.com/kyoh86/richgo/sample/buildfail [build failed]
START| Cover05
PASS | Cover05 (0.00s)
PASS | Cover05 (0.00s)
COVER| 50.0% [#####_____]
PASS | github.com/kyoh86/richgo/sample/cover05 0.015s
COVER| 50.0% [#####_____]
START| CoverAll
PASS | CoverAll (0.00s)
PASS | CoverAll (0.00s)
COVER| 100.0% [##########]
PASS | github.com/kyoh86/richgo/sample/coverall 0.008s
COVER| 100.0% [##########]
Expand All @@ -43,7 +43,7 @@
PASS | github.com/kyoh86/richgo/sample/emptytest 0.013s
COVER| 0.0% [__________]
START| Nocover
PASS | Nocover (0.00s)
PASS | Nocover (0.00s)
 | nocover_test.go:6: accept
COVER| 0.0% [__________]
PASS | github.com/kyoh86/richgo/sample/nocover 0.007s
Expand Down

0 comments on commit 5193bb0

Please sign in to comment.