1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-24 03:47:45 +02:00

adds multifile test

This commit is contained in:
chavacava 2018-06-12 06:54:21 +02:00
parent 97315129a9
commit 4f2e0613fc
3 changed files with 14 additions and 4 deletions

View File

@ -11,7 +11,7 @@ func (t foo) aFoo() {
func (t *foo) AFoo() { // MATCH /Method 'AFoo' differs only by capitalization to method 'aFoo'/
func (t *foo) AFoo() { // MATCH /Method 'AFoo' differs only by capitalization to other method of 'pkg/foo'/
return
}
@ -31,7 +31,7 @@ func aGlobal(){
}
func AGlobal(){ // MATCH /Method 'AGlobal' differs only by capitalization to method 'aGlobal'/
func AGlobal(){ // MATCH /Function 'AGlobal' differs only by capitalization to other function/
}
func ABar() { // Should not warn
@ -46,6 +46,6 @@ func (t foo) ABar() { // Should not warn
return
}
func (t bar) ABar() { // MATCH /Method 'ABar' differs only by capitalization to method 'aBar'/
func (t bar) ABar() { // MATCH /Method 'ABar' differs only by capitalization to other method of 'pkg/bar'/
return
}

View File

@ -0,0 +1,8 @@
// Test of confusing-naming rule.
// Package pkg ...
package pkg
func aglobal(){ // MATCH /Function 'aglobal' differs only by capitalization to other function/
}

View File

@ -8,5 +8,7 @@ import (
// TestConfusingNaming rule.
func TestConfusingNaming(t *testing.T) {
testRule(t, "confusing-naming", &rule.ConfusingNamingRule{})
testRule(t, "confusing-naming1", &rule.ConfusingNamingRule{})
testRule(t, "confusing-naming2", &rule.ConfusingNamingRule{})
}