package punctuation import ( "context" "testing" ) func TestHeuristicRU_question(t *testing.T) { h := Heuristic{} out, err := h.Restore(context.Background(), "как дела", "ru") if err != nil { t.Fatal(err) } if !stringsHasSuffix(out, "?") { t.Fatalf("expected question mark, got %q", out) } } func TestHeuristicEN_period(t *testing.T) { h := Heuristic{} out, err := h.Restore(context.Background(), "hello world", "en") if err != nil { t.Fatal(err) } if !stringsHasSuffix(out, ".") { t.Fatalf("expected period, got %q", out) } } func stringsHasSuffix(s, suffix string) bool { return len(s) >= len(suffix) && s[len(s)-len(suffix):] == suffix }