forked from vim-test/vim-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgotest_spec.vim
119 lines (80 loc) · 2.62 KB
/
gotest_spec.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
source spec/support/helpers.vim
describe "GoTest"
before
cd spec/fixtures/gotest
end
after
call Teardown()
cd -
end
it "runs nearest tests"
view +5 normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''TestNumbers$'' ./.'
view +8 normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''TestNumbers/adding_two_numbers$'' ./.'
view +12 normal_test.go
TestNearest
let test_name = shellescape('\[\]\.\*\+\?\|\$\^\(\)')[1:-2]
Expect g:test#last_command == 'go test -run ''TestNumbers/'. test_name .'$'' ./.'
view +17 normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''TestNumbers/this_is/nested$'' ./.'
view +23 normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''Testテスト$'' ./.'
view +27 normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''ExampleSomething$'' ./.'
view +36 normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''TestSomethingInASuite$'' ./.'
end
it "runs nearest tests in subdirectory"
view +5 mypackage/normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''TestNumbers$'' ./mypackage'
view +9 mypackage/normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''Testテスト$'' ./mypackage'
view +13 mypackage/normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''ExampleSomething$'' ./mypackage'
view +22 mypackage/normal_test.go
TestNearest
Expect g:test#last_command == 'go test -run ''TestSomething$'' ./mypackage'
end
it "runs file test if nearest test couldn't be found"
view +1 normal_test.go
TestNearest
Expect g:test#last_command == 'go test'
end
it "runs file tests"
view normal_test.go
TestFile
Expect g:test#last_command == 'go test'
end
it "runs tests in subdirectory"
view mypackage/normal_test.go
TestFile
Expect g:test#last_command == 'go test ./mypackage/...'
end
it "runs test suites"
view normal_test.go
TestSuite
Expect g:test#last_command == 'go test ./...'
end
it "runs tests in a file with build tags"
view +14 build_tags_test.go
TestNearest
Expect g:test#last_command == 'go test -tags=foo,hello,world,!bar,red,black -run ''TestNumbers$'' ./.'
TestFile
Expect g:test#last_command == 'go test -tags=foo,hello,world,!bar,red,black'
end
it "runs test suite without tags"
view +14 build_tags_test.go
TestSuite
Expect g:test#last_command == 'go test ./...'
end
end