mirror of
https://github.com/emirpasic/gods
synced 2024-11-04 18:00:21 +00:00
- fix spelling mistake everywhere (expacted -> expected) and go vet/fmt
This commit is contained in:
parent
84af8bb166
commit
160299d0f7
@ -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()
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user