added some corner cases to content.go generation tests

This commit is contained in:
Manuel Carmona
2017-04-20 08:29:12 +02:00
parent 63d4d9bf24
commit 28dc452853
3 changed files with 134 additions and 14 deletions

View File

@ -299,7 +299,7 @@ func getHeuristics(line string) []*heuristic {
}
if reg != "" {
reg = convToValidRegexp(reg)
reg = convertToValidRegexp(reg)
heuristics = append(heuristics, &heuristic{Regexp: reg})
}
}
@ -327,7 +327,7 @@ func replaceRegexpVariables(reg string) string {
return repl
}
func convToValidRegexp(reg string) string {
func convertToValidRegexp(reg string) string {
// example: `/^(\s*)(<Project|<Import|<Property|<?xml|xmlns)/i``
// Ruby modifier "m" matches multiple lines, recognizing newlines as normal characters, Go use flag "s" for that.
const (