Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of go-translate #1

Merged
merged 14 commits into from Mar 22, 2019

Add language tests

  • Loading branch information
yrliou committed Mar 18, 2019
commit 711e78918e5c9f7bc18736b587eed92a9e22e6da
@@ -0,0 +1,14 @@
package language

import (
"github.com/stretchr/testify/assert"
"testing"
)

func TestToGoogleLanguageList(t *testing.T) {
msList := []byte(`{"translation":{"af":{"name":"Afrikaans","nativeName":"Afrikaans","dir":"ltr"},"en":{"name":"English","nativeName":"English","dir":"ltr"}}}`)
googleList := []byte(`{"sl":{"af":"Afrikaans","en":"English"},"tl":{"af":"Afrikaans","en":"English"}}`)
list, err := ToGoogleLanguageList(msList)
assert.Equal(t, nil, err)
assert.Equal(t, googleList, list)
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.