Skip to content

Commit

Permalink
add test for shuffling
Browse files Browse the repository at this point in the history
  • Loading branch information
jraedisch committed Dec 31, 2017
1 parent 667b961 commit ff9cf9d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"reflect"
"sort"
"testing"
)

Expand All @@ -13,3 +14,12 @@ func TestDistributeVictims(t *testing.T) {
t.Errorf("expected\n%v\ngot\n%v", expected, actual)
}
}

func TestShuffleNames(t *testing.T) {
sorted := []string{"A", "B", "C", "D"}
shuffled := shuffleNames(sorted)
sort.Strings(shuffled)
if !reflect.DeepEqual(sorted, shuffled) {
t.Errorf("shuffled does not contain the right names: %v", shuffled)
}
}

0 comments on commit ff9cf9d

Please sign in to comment.