all repos

scratch @ 78737e5b34dda8993c2c6ae70225d45fb3896607

⭐ me doing recreational ~~drugs~~ programming

scratch/algos/bubblesort_test.go (view raw)

Oleksandr Smirnov Oleksandr Smirnov
olexsmir@gmail.com
algos: bubble sort why not, 1 month ago
1
package algos
2
3
import (
4
	"reflect"
5
	"testing"
6
)
7
8
func TestBubleSort(t *testing.T) {
9
	inp := []int{9, 3, 7, 4, 69, 420, 42}
10
	out := []int{3, 4, 7, 9, 42, 69, 420}
11
12
	BubbleSort(inp)
13
	if !reflect.DeepEqual((inp), out) {
14
		t.Fatalf("i fucked up, %#v, %#v\n", inp, out)
15
	}
16
}