File: adjacmartix_test.go

package info (click to toggle)
golang-github-nbutton23-zxcvbn-go 0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: makefile: 6
file content (33 lines) | stat: -rw-r--r-- 1,066 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package adjacency

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

/*
nbutton: Really the value is not as important to me than they don't change, which happened during development.
*/
func TestCalculateDegreeQwert(t *testing.T) {
	avgDegreeQwert := BuildQwerty().CalculateAvgDegree()

	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, float64(1.5319148936170213), avgDegreeQwert, "Avg degree for dvorak should be 1.53191489361702135")
}

func TestCalculateDegreeKeypad(t *testing.T) {
	avgDegreeQwert := BuildKeypad().CalculateAvgDegree()

	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, float64(0.65625), avgDegreeQwert, "Avg degree for mackeyPad should be 0.65625")
}