diff --git a/src/search/params.go b/src/search/params.go index 4bc02d8d..610fd0d5 100644 --- a/src/search/params.go +++ b/src/search/params.go @@ -18,7 +18,9 @@ func validateSuggestParams(query string, locale options.Locale) error { } func validateSearchParams(query string, opts options.Options) error { - validateSuggestParams(query, opts.Locale) + if err := validateSuggestParams(query, opts.Locale); err != nil { + return err + } if opts.Pages.Start < 0 { return fmt.Errorf("pages start can't be negative") diff --git a/src/search/result/shorten_test.go b/src/search/result/shorten_test.go index 5a8c625a..91898e41 100644 --- a/src/search/result/shorten_test.go +++ b/src/search/result/shorten_test.go @@ -179,18 +179,6 @@ func TestShorten3(t *testing.T) { {"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", "Lor"}, } - // Create test results. - var results = make([]General, 0, len(tests)) - for _, test := range tests { - v := General{ - generalJSON: generalJSON{ - Title: test.orig, - Description: test.orig, - }, - } - results = append(results, v) - } - // Check if the results are shortened as expected. for _, test := range tests { short := shortString(test.orig, 3)