Skip to content

Commit

Permalink
translate: fix broken integration test
Browse files Browse the repository at this point in the history
"Hello" was previously being translated to "Bonjour", but has recently
started instead being translated to "Salut" due to some changes in the
model/service.

So, this CL changes the test to assert on a less ambiguous word:
"Thanks" == "Merci".

Change-Id: I56120c8b984ad720bb9a0272e7cb2d82c83dbfb1
Reviewed-on: https://code-review.googlesource.com/c/gocloud/+/45530
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
  • Loading branch information
jeanbza committed Sep 16, 2019
1 parent c981458 commit d522438
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions translate/translate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,15 @@ func TestTranslateModel(t *testing.T) {
c := initTest(ctx, t)
defer c.Close()

trs, err := c.Translate(ctx, []string{"Hello"}, language.French, &Options{Model: "nmt"})
trs, err := c.Translate(ctx, []string{"Thanks"}, language.French, &Options{Model: "nmt"})
if err != nil {
t.Fatal(err)
}
if len(trs) != 1 {
t.Fatalf("wanted one Translation, got %d", len(trs))
}
tr := trs[0]
if got, want := tr.Text, "Bonjour"; got != want {
if got, want := tr.Text, "Merci"; got != want {
t.Errorf("text: got %q, want %q", got, want)
}
if got, want := tr.Model, "nmt"; got != want {
Expand Down

0 comments on commit d522438

Please sign in to comment.