Post-rebase fix

Dead code removed in one branch, ended up being used in another.
This commit is contained in:
Stanisław Barzowski 2017-10-10 11:19:59 -04:00 committed by Dave Cunningham
parent 4b0735826d
commit 171cdd67f9

View File

@ -23,6 +23,7 @@ import (
"path/filepath"
"strings"
"testing"
"unicode/utf8"
"github.com/sergi/go-diff/diffmatchpatch"
)
@ -196,6 +197,25 @@ func TestMinimalError(t *testing.T) {
// TODO(sbarzowski) test pretty errors once they are stable-ish
// probably "golden" pattern is the right one for that
func removeExcessiveWhitespace(s string) string {
var buf bytes.Buffer
separated := true
for i, w := 0, 0; i < len(s); i += w {
runeValue, width := utf8.DecodeRuneInString(s[i:])
if runeValue == '\n' || runeValue == ' ' {
if !separated {
buf.WriteString(" ")
separated = true
}
} else {
buf.WriteRune(runeValue)
separated = false
}
w = width
}
return buf.String()
}
func TestCustomImporter(t *testing.T) {
vm := MakeVM()
vm.Importer(&MemoryImporter{