Commit 4a129e11 authored by santiaago's avatar santiaago
Browse files

test Length and Heigth from key

parent 0c59ba06
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -102,3 +102,29 @@ func TestAnthenasFromKey(t *testing.T) {
		t.Errorf("expected %d got %d", expected, got)
	}
}

func TestLengthFromKey(t *testing.T) {
	got := LengthFromKey('h')
	expected := 5
	if got != expected {
		t.Errorf("expected %d got %d", expected, got)
	}
	got = LengthFromKey('a')
	expected = 5
	if got != expected {
		t.Errorf("expected %d got %d", expected, got)
	}
}

func TestHeightFromKey(t *testing.T) {
	got := HeightFromKey('j')
	expected := 6
	if got != expected {
		t.Errorf("expected %d got %d", expected, got)
	}
	got = HeightFromKey('a')
	expected = 7
	if got != expected {
		t.Errorf("expected %d got %d", expected, got)
	}
}