aboutsummaryrefslogtreecommitdiffstats
path: root/utils_test.go
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2016-05-05 23:24:44 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2016-05-05 23:24:44 -0400
commit2fdccd98d65b03f6550d1824a7c5541cb1d175cf (patch)
treef393245d555923813d0c44e09e3f59c90267b05d /utils_test.go
parentbe4c150fe17c4869e80acd2a18a380aa91c49d65 (diff)
downloadpos-2fdccd98d65b03f6550d1824a7c5541cb1d175cf.tar.gz
Add Fisher-Yates schuffle
Diffstat (limited to 'utils_test.go')
-rw-r--r--utils_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/utils_test.go b/utils_test.go
index c42ecef..7b912a0 100644
--- a/utils_test.go
+++ b/utils_test.go
@@ -1,6 +1,10 @@
package main
-import "testing"
+import (
+ "fmt"
+ "sort"
+ "testing"
+)
func TestLog(t *testing.T) {
tests := []struct {
@@ -72,3 +76,9 @@ func TestPost(t *testing.T) {
}
}
+
+func TestShuffle(t *testing.T) {
+ a := sort.IntSlice([]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9})
+ Shuffle(a)
+ fmt.Println(a)
+}