diff options
Diffstat (limited to 'gcc-4.8.1/libgo/go/exp/locale/collate/sort_test.go')
-rw-r--r-- | gcc-4.8.1/libgo/go/exp/locale/collate/sort_test.go | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/gcc-4.8.1/libgo/go/exp/locale/collate/sort_test.go b/gcc-4.8.1/libgo/go/exp/locale/collate/sort_test.go deleted file mode 100644 index d0682f48e..000000000 --- a/gcc-4.8.1/libgo/go/exp/locale/collate/sort_test.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package collate_test - -import ( - "exp/locale/collate" - "fmt" - "testing" -) - -func ExampleCollator_Strings() { - c := collate.New("root") - strings := []string{ - "ad", - "äb", - "ac", - } - c.Strings(strings) - fmt.Println(strings) - // Output: [äb ac ad] -} - -type sorter []string - -func (s sorter) Len() int { - return len(s) -} - -func (s sorter) Swap(i, j int) { - s[j], s[i] = s[i], s[j] -} - -func (s sorter) Bytes(i int) []byte { - return []byte(s[i]) -} - -func TestSort(t *testing.T) { - c := collate.New("en") - strings := []string{ - "bcd", - "abc", - "ddd", - } - c.Sort(sorter(strings)) - res := fmt.Sprint(strings) - want := "[abc bcd ddd]" - if res != want { - t.Errorf("found %s; want %s", res, want) - } -} |