Skip to content
Snippets Groups Projects

Initial implementation of an elasticsearch indexer in Go

Merged Nick Thomas requested to merge 1-initial-implementation into master
All threads resolved!
1 file
+ 26
0
Compare changes
  • Side-by-side
  • Inline
+ 26
0
@@ -94,6 +94,32 @@ func TestIndexingRemovesFiles(t *testing.T) {
assert.Error(t, err)
}
// Go source is defined to be UTF-8 encoded, so literals here are UTF-8
func TestIndexingTranscodesToUTF8(t *testing.T) {
checkDeps(t)
c, td := buildIndex(t)
defer td()
assert.NoError(t, run("", headSHA))
for _, tc := range []struct{
path string
expected string
} {
{"encoding/iso8859.txt", "狞\n"}, // GB18030
{"encoding/test.txt", "これはテストです。\nこれもマージして下さい。\n\nAdd excel file.\nDelete excel file."}, // SHIFT_JIS
} {
blob, err := c.GetBlob(tc.path)
assert.NoError(t, err)
blobDoc := make(map[string]*indexer.Blob)
assert.NoError(t, json.Unmarshal(*blob.Source, &blobDoc))
assert.Equal(t, tc.expected, blobDoc["blob"].Content)
}
}
func TestIndexingGitlabTest(t *testing.T) {
checkDeps(t)
c, td := buildIndex(t)
Loading