Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

32 rader
672 B

  1. // Copyright 2013 The Go Authors. All rights reserved.
  2. //
  3. // Use of this source code is governed by a BSD-style
  4. // license that can be found in the LICENSE file or at
  5. // https://developers.google.com/open-source/licenses/bsd.
  6. package database
  7. import (
  8. "testing"
  9. )
  10. var stemTests = []struct {
  11. s, expected string
  12. }{
  13. {"html", "html"},
  14. {"strings", "string"},
  15. {"ballroom", "ballroom"},
  16. {"mechanicalization", "mech"},
  17. {"pragmaticality", "pragm"},
  18. {"rationalistically", "rat"},
  19. }
  20. func TestStem(t *testing.T) {
  21. for _, tt := range stemTests {
  22. actual := stem(tt.s)
  23. if actual != tt.expected {
  24. t.Errorf("stem(%q) = %q, want %q", tt.s, actual, tt.expected)
  25. }
  26. }
  27. }