summary refs log tree commit diff stats
path: root/lexical/sort_test.go
blob: c4a823e3dfa2bc9680a5dee5044132049a14c510 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package lexical

import "testing"

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

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

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