gitee.com/wgliang/goreporter@v0.0.0-20180902115603-df1b20f7c5d0/linters/spellcheck/misspell/falsepositives_test.go (about)

     1  package misspell
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestFalsePositives(t *testing.T) {
     8  	cases := []string{
     9  		"drinkeries",
    10  		"subscripting",
    11  		"unprojected",
    12  		"updaters",
    13  		"templatize",
    14  		"requesters",
    15  		"requestors",
    16  		"replicaset",
    17  		"parallelise",
    18  		"parallelize",
    19  		"perceptron",  // http://foldoc.org/perceptron
    20  		"perceptrons", // ^^
    21  		"convertors",  // alt spelling
    22  		"adventurers",
    23  		" s.svc.GetObject ",
    24  		"infinitie.net",
    25  		"foo summaries\n",
    26  		"thru",
    27  		"publically",
    28  		"6YUO5",   // base64
    29  		"cleaner", // triggered by "cleane->cleanser" and partial word FP
    30  		"  http.Redirect(w, req, req.URL.Path, http.StatusFound) ",
    31  		"url is http://zeebra.com ",
    32  		"path is /zeebra?zeebra=zeebra ",
    33  		"Malcom_McLean",
    34  		"implementor", // alt spelling, see https://github.com/client9/misspell/issues/46
    35  		"searchtypes",
    36  		" witness",
    37  		"returndata",
    38  		"UNDERSTOOD",
    39  		"textinterface",
    40  		" committed ",
    41  		"committed",
    42  		"Bengali",
    43  		"Portuguese",
    44  		"scientists",
    45  		"causally",
    46  		"embarrassing",
    47  		"setuptools", // python package
    48  		"committing",
    49  		"guises",
    50  		"disguise",
    51  		"begging",
    52  		"cmo",
    53  		"cmos",
    54  		"borked",
    55  		"hadn't",
    56  		"Iceweasel",
    57  		"summarised",
    58  		"autorenew",
    59  		"travelling",
    60  		"republished",
    61  		"fallthru",
    62  		"pruning",
    63  		"deb.VersionDontCare",
    64  		"authtag",
    65  		"intrepid",
    66  		"usefully",
    67  		"there",
    68  		"definite",
    69  		"earliest",
    70  		"Japanese",
    71  		"international",
    72  		"excellent",
    73  		"gracefully",
    74  		"carefully",
    75  		"class",
    76  		"include",
    77  		"process",
    78  		"address",
    79  		"attempt",
    80  		"large",
    81  		"although",
    82  		"specific",
    83  		"taste",
    84  		"against",
    85  		"successfully",
    86  		"unsuccessfully",
    87  		"occurred",
    88  		"agree",
    89  		"controlled",
    90  		"publisher",
    91  		"strategy",
    92  		"geoposition",
    93  		"paginated",
    94  		"happened",
    95  		"relative",
    96  		"computing",
    97  		"language",
    98  		"manual",
    99  		"token",
   100  		"into",
   101  		"nothing",
   102  		"datatool",
   103  		"propose",
   104  		"learnt",
   105  		"tolerant",
   106  		"whitehat",
   107  		"monotonic",
   108  		"comprised",
   109  		"indemnity",
   110  		"flattened",
   111  		"interrupted",
   112  		"inotify",
   113  		"occasional",
   114  		"forging",
   115  		"ampersand",
   116  		"decomposition",
   117  		"commit",
   118  		"programmer", // "grammer"
   119  		//		"requestsinserted",
   120  		"seeked",      // technical word
   121  		"bodyreader",  // variable name
   122  		"cantPrepare", // variable name
   123  		"dontPrepare", // variable name
   124  	}
   125  	r := New()
   126  	r.Debug = true
   127  	for casenum, tt := range cases {
   128  		got, _ := r.Replace(tt)
   129  		if got != tt {
   130  			t.Errorf("%d: %q got converted to %q", casenum, tt, got)
   131  		}
   132  	}
   133  }