github.com/Johnny2210/revive@v1.0.8-0.20210625134200-febf37ccd0f5/test/add-constant_test.go (about)

     1  package test
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/mgechev/revive/lint"
     7  	"github.com/mgechev/revive/rule"
     8  )
     9  
    10  func TestAddConstant(t *testing.T) {
    11  	args := []interface{}{map[string]interface{}{
    12  		"maxLitCount": "2",
    13  		"allowStrs":   "\"\"",
    14  		"allowInts":   "0,1,2",
    15  		"allowFloats": "0.0,1.0",
    16  	}}
    17  
    18  	testRule(t, "add-constant", &rule.AddConstantRule{}, &lint.RuleConfig{
    19  		Arguments: args,
    20  	})
    21  }