- fix spelling mistake everywhere (expacted -> expected) and go vet/fmt

This commit is contained in:
Emir Pasic 2016-06-12 15:04:33 +02:00
parent 84af8bb166
commit 160299d0f7
4 changed files with 28 additions and 28 deletions

View File

@ -51,13 +51,13 @@ func TestHashMap(t *testing.T) {
}
// test Keys()
if actualValue, expactedValue := m.Keys(), []interface{}{1, 2, 3, 4, 5, 6, 7}; !sameElements(actualValue, expactedValue) {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := m.Keys(), []interface{}{1, 2, 3, 4, 5, 6, 7}; !sameElements(actualValue, expectedValue) {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// test Values()
if actualValue, expactedValue := m.Values(), []interface{}{"a", "b", "c", "d", "e", "f", "g"}; !sameElements(actualValue, expactedValue) {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := m.Values(), []interface{}{"a", "b", "c", "d", "e", "f", "g"}; !sameElements(actualValue, expectedValue) {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// key,expectedValue,expectedFound
@ -88,13 +88,13 @@ func TestHashMap(t *testing.T) {
m.Remove(5)
// test Keys()
if actualValue, expactedValue := m.Keys(), []interface{}{1, 2, 3, 4}; !sameElements(actualValue, expactedValue) {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := m.Keys(), []interface{}{1, 2, 3, 4}; !sameElements(actualValue, expectedValue) {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// test Values()
if actualValue, expactedValue := m.Values(), []interface{}{"a", "b", "c", "d"}; !sameElements(actualValue, expactedValue) {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := m.Values(), []interface{}{"a", "b", "c", "d"}; !sameElements(actualValue, expectedValue) {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// Test Size()
if actualValue := m.Size(); actualValue != 4 {
@ -129,13 +129,13 @@ func TestHashMap(t *testing.T) {
m.Remove(2)
// Test Keys()
if actualValue, expactedValue := fmt.Sprintf("%s", m.Keys()), "[]"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%s", m.Keys()), "[]"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// test Values()
if actualValue, expactedValue := fmt.Sprintf("%s", m.Values()), "[]"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%s", m.Values()), "[]"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// Test Size()

View File

@ -70,8 +70,8 @@ func TestHashSet(t *testing.T) {
set.Remove()
set.Remove(1)
if actualValue, expactedValues := fmt.Sprintf("%d%d", set.Values()...), [2]string{"23", "32"}; actualValue != expactedValues[0] && actualValue != expactedValues[1] {
t.Errorf("Got %v expected %v", actualValue, expactedValues)
if actualValue, expectedValues := fmt.Sprintf("%d%d", set.Values()...), [2]string{"23", "32"}; actualValue != expectedValues[0] && actualValue != expectedValues[1] {
t.Errorf("Got %v expected %v", actualValue, expectedValues)
}
if actualValue := set.Contains(1); actualValue != false {

View File

@ -61,8 +61,8 @@ func TestTreeSet(t *testing.T) {
// repeat 10 time since map in golang has a random iteration order each time and we want to make sure that the set is ordered
for i := 1; i <= 10; i++ {
if actualValue, expactedValue := fmt.Sprintf("%d%d%d", set.Values()...), "123"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%d%d%d", set.Values()...), "123"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
}

View File

@ -51,13 +51,13 @@ func TestRedBlackTree(t *testing.T) {
}
// test Keys()
if actualValue, expactedValue := fmt.Sprintf("%d%d%d%d%d%d%d", tree.Keys()...), "1234567"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%d%d%d%d%d%d%d", tree.Keys()...), "1234567"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// test Values()
if actualValue, expactedValue := fmt.Sprintf("%s%s%s%s%s%s%s", tree.Values()...), "abcdefg"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%s%s%s%s%s%s%s", tree.Values()...), "abcdefg"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// key,expectedValue,expectedFound
@ -88,13 +88,13 @@ func TestRedBlackTree(t *testing.T) {
tree.Remove(5)
// Test Keys()
if actualValue, expactedValue := fmt.Sprintf("%d%d%d%d", tree.Keys()...), "1234"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%d%d%d%d", tree.Keys()...), "1234"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// test Values()
if actualValue, expactedValue := fmt.Sprintf("%s%s%s%s", tree.Values()...), "abcd"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%s%s%s%s", tree.Values()...), "abcd"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// Test Size()
@ -130,13 +130,13 @@ func TestRedBlackTree(t *testing.T) {
tree.Remove(2)
// Test Keys()
if actualValue, expactedValue := fmt.Sprintf("%s", tree.Keys()), "[]"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%s", tree.Keys()), "[]"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// test Values()
if actualValue, expactedValue := fmt.Sprintf("%s", tree.Values()), "[]"; actualValue != expactedValue {
t.Errorf("Got %v expected %v", actualValue, expactedValue)
if actualValue, expectedValue := fmt.Sprintf("%s", tree.Values()), "[]"; actualValue != expectedValue {
t.Errorf("Got %v expected %v", actualValue, expectedValue)
}
// Test Size()