v / cmd / tools / vvet / tests / module_file_test.vv
55 lines · 45 sloc · 691 bytes · ee663364de79eeb5a0421949d242075c2ba8d31b
Raw
1module foo
2
3struct Foo {
4 foo int
5}
6
7pub fn foo() string {
8 // Missing doc
9 return 'foo'
10}
11
12// foo does bar
13pub fn bar() string {
14 // not using convention style: '// <fn name>'
15 return 'bar'
16}
17
18// fooo does x
19pub fn fooo() string {
20 // Documented
21 return 'fooo'
22}
23
24// booo does x
25fn booo() string {
26 // Documented, but not pub
27 return 'booo'
28}
29
30fn boo() string {
31 // Missing doc
32 return 'boo'
33}
34
35pub fn (f Foo) foo() string {
36 // Missing doc
37 return f.fo()
38}
39
40fn (f Foo) fo() string {
41 // Missing doc, but not pub
42 return 'foo'
43}
44
45// wrong doc
46pub fn (f Foo) fooo() string {
47 // not using convention
48 return f.fo()
49}
50
51// boo
52pub fn (f Foo) boo() string {
53 // Incomplete doc
54 return f.fo()
55}
56