mirror of
https://github.com/mgechev/revive.git
synced 2024-12-12 10:44:59 +02:00
31 lines
754 B
Go
31 lines
754 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mgechev/revive/lint"
|
|
"github.com/mgechev/revive/rule"
|
|
)
|
|
|
|
func TestLintFileHeader(t *testing.T) {
|
|
testRule(t, "lint-file-header1", &rule.FileHeaderRule{}, &lint.RuleConfig{
|
|
Arguments: []interface{}{"foobar"},
|
|
})
|
|
|
|
testRule(t, "lint-file-header2", &rule.FileHeaderRule{}, &lint.RuleConfig{
|
|
Arguments: []interface{}{"foobar"},
|
|
})
|
|
|
|
testRule(t, "lint-file-header3", &rule.FileHeaderRule{}, &lint.RuleConfig{
|
|
Arguments: []interface{}{"foobar"},
|
|
})
|
|
|
|
testRule(t, "lint-file-header4", &rule.FileHeaderRule{}, &lint.RuleConfig{
|
|
Arguments: []interface{}{"^\\sfoobar$"},
|
|
})
|
|
|
|
testRule(t, "lint-file-header5", &rule.FileHeaderRule{}, &lint.RuleConfig{
|
|
Arguments: []interface{}{"^\\sfoo.*bar$"},
|
|
})
|
|
}
|