fixed some test. I update some of the math function back in the day, but never updated the test.

This commit is contained in:
Nathan Button 2016-01-13 15:47:44 -07:00
parent 5ab9bcfcf0
commit e3fb346bcb
2 changed files with 7 additions and 7 deletions

View File

@ -11,23 +11,23 @@ nbutton: Really the value is not as important to me than they don't change, whic
func TestCalculateDegreeQwert(t *testing.T) {
avgDegreeQwert := BuildQwerty().CalculateAvgDegree()
assert.Equal(t, float32(1.531915), avgDegreeQwert, "Avg degree for qwerty should be 1.531915")
assert.Equal(t, float64(1.5319148936170213), avgDegreeQwert, "Avg degree for qwerty should be 1.5319148936170213")
}
func TestCalculateDegreeDvorak(t *testing.T) {
avgDegreeQwert := BuildDvorak().CalculateAvgDegree()
assert.Equal(t, float32(1.531915), avgDegreeQwert, "Avg degree for dvorak should be 1.531915")
assert.Equal(t, float64(1.5319148936170213), avgDegreeQwert, "Avg degree for dvorak should be 1.53191489361702135")
}
func TestCalculateDegreeKeypad(t *testing.T) {
avgDegreeQwert := BuildKeypad().CalculateAvgDegree()
assert.Equal(t, float32(0.62222224), avgDegreeQwert, "Avg degree for keypad should be 0.62222224")
assert.Equal(t, float64(0.6333333333333333), avgDegreeQwert, "Avg degree for keypad should be 0.6333333333333333")
}
func TestCalculateDegreeMacKepad(t *testing.T) {
avgDegreeQwert := BuildMacKeypad().CalculateAvgDegree()
assert.Equal(t, float32(0.6458333), avgDegreeQwert, "Avg degree for mackeyPad should be 0.6458333")
assert.Equal(t, float64(0.65625), avgDegreeQwert, "Avg degree for mackeyPad should be 0.65625")
}

View File

@ -8,17 +8,17 @@ import (
func TestNchoseK100and2(t *testing.T) {
nCk := NChoseK(100, 2)
assert.Equal(t, uint64(4950), nCk, "100 chose 2 should equal 4950")
assert.Equal(t, float64(4950), nCk, "100 chose 2 should equal 4950")
}
func TestNChoseKwereNlessK(t *testing.T) {
nCk := NChoseK(1, 2)
assert.Equal(t, uint64(0), nCk, "When n is less than k always 0")
assert.Equal(t, float64(0), nCk, "When n is less than k always 0")
}
func TestNChoseKWereKis0(t *testing.T) {
nCk := NChoseK(50, 0)
assert.Equal(t, uint64(1), nCk, "When K is 0 then 1")
assert.Equal(t, float64(1), nCk, "When K is 0 then 1")
}