@@ -3,20 +3,20 @@ package symboltable
33import (
44 "testing"
55
6- . "github.com/moorara/algo/generic"
7- . "github.com/moorara/algo/hash"
6+ "github.com/moorara/algo/generic"
7+ "github.com/moorara/algo/hash"
88)
99
1010func getQuadHashTableTests () []symbolTableTest [string , int ] {
11- hashFunc := HashFuncForString [string ](nil )
12- eqKey := NewEqualFunc [string ]()
13- eqVal := NewEqualFunc [int ]()
11+ hashFunc := hash. HashFuncForString [string ](nil )
12+ eqKey := generic . NewEqualFunc [string ]()
13+ eqVal := generic . NewEqualFunc [int ]()
1414 opts := HashOpts {}
1515
1616 tests := getSymbolTableTests ()
1717
1818 tests [0 ].symbolTable = "Quadratic Probing Hash Table"
19- tests [0 ].equal = NewQuadraticHashTable [ string , int ] (hashFunc , eqKey , eqVal , opts )
19+ tests [0 ].equal = NewQuadraticHashTable (hashFunc , eqKey , eqVal , opts )
2020 tests [0 ].equal .Put ("Apple" , 182 )
2121 tests [0 ].equal .Put ("Avocado" , 200 )
2222 tests [0 ].equal .Put ("Banana" , 120 )
@@ -35,7 +35,7 @@ func getQuadHashTableTests() []symbolTableTest[string, int] {
3535 tests [0 ].expectedEqual = true
3636
3737 tests [1 ].symbolTable = "Quadratic Probing Hash Table"
38- tests [1 ].equal = NewQuadraticHashTable [ string , int ] (hashFunc , eqKey , eqVal , opts )
38+ tests [1 ].equal = NewQuadraticHashTable (hashFunc , eqKey , eqVal , opts )
3939 tests [1 ].equal .Put ("Golden Pheasant" , 15 )
4040 tests [1 ].equal .Put ("Harpy Eagle" , 35 )
4141 tests [1 ].equal .Put ("Kingfisher" , 15 )
@@ -47,7 +47,7 @@ func getQuadHashTableTests() []symbolTableTest[string, int] {
4747 tests [1 ].expectedEqual = true
4848
4949 tests [2 ].symbolTable = "Quadratic Probing Hash Table"
50- tests [2 ].equal = NewQuadraticHashTable [ string , int ] (hashFunc , eqKey , eqVal , opts )
50+ tests [2 ].equal = NewQuadraticHashTable (hashFunc , eqKey , eqVal , opts )
5151 tests [2 ].equal .Put ("Accordion" , 50 )
5252 tests [2 ].equal .Put ("Bassoon" , 140 )
5353 tests [2 ].equal .Put ("Cello" , 120 )
@@ -67,7 +67,7 @@ func getQuadHashTableTests() []symbolTableTest[string, int] {
6767 tests [2 ].expectedEqual = false
6868
6969 tests [3 ].symbolTable = "Quadratic Probing Hash Table"
70- tests [3 ].equal = NewQuadraticHashTable [ string , int ] (hashFunc , eqKey , eqVal , opts )
70+ tests [3 ].equal = NewQuadraticHashTable (hashFunc , eqKey , eqVal , opts )
7171 tests [3 ].equal .Put ("Berlin" , 10 )
7272 // tests[3].equal.Put("London", 11)
7373 tests [3 ].equal .Put ("Montreal" , 6 )
@@ -91,7 +91,7 @@ func TestQuadraticHashTable(t *testing.T) {
9191 tests := getQuadHashTableTests ()
9292
9393 for _ , tc := range tests {
94- ht := NewQuadraticHashTable [ string , int ] (tc .hashKey , tc .eqKey , tc .eqVal , tc .opts )
94+ ht := NewQuadraticHashTable (tc .hashKey , tc .eqKey , tc .eqVal , tc .opts )
9595 runSymbolTableTest (t , ht , tc )
9696 }
9797}
0 commit comments