summary refs log blame commit diff stats
path: root/lexical/slowsort_test.go
blob: 20e1a3c6a4705553326e8aa3bc7ca21d9954754b (plain) (tree)


















                                                                     
package lexical

import "testing"

// TestSlowSort tests the SlowSort func.
func TestSlowSort(t *testing.T) {
	words := make(map[string]string)

	words["dcba"] = "abcd"
	words["zyx"] = "xyz"

	for word, sorted := range words {
		s := SlowSort(word)
		if s != sorted {
			t.Errorf("Sort func failed, got %s, want %s",
				s, sorted)
		}
	}
}