Skip to content

Commit b80a09e

Browse files
author
Gonzalo Diaz
committed
[REFACTOR] [Hacker Rank] Interview Preparation Kit: Array: 2D Array - DS. Solved ✅. Some renames.
1 parent 97861c1 commit b80a09e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

exercises/hackerrank/interview_preparation_kit/arrays/2d_array_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,30 @@ import (
99
"gon.cl/algorithms/utils"
1010
)
1111

12-
type TestCase struct {
12+
type TwoDArrayTestCase struct {
1313
Input [][]int32 `json:"input"`
1414
Expected int32 `json:"expected"`
1515
}
1616

17-
var testCases []TestCase
17+
var TwoDArrayTestCases []TwoDArrayTestCase
1818

1919
// You can use testing.T, if you want to test the code without benchmarking
20-
func setupSuite(t testing.TB) {
20+
func twoDArraySetupSuite(t testing.TB) {
2121
wd, _ := os.Getwd()
22-
filepath := wd + "/2d_array.testcases.json"
22+
filepath := wd + "/2d_array.TwoDArrayTestcases.json"
2323
t.Log("Setup test cases from JSON: ", filepath)
2424

25-
var _, err = utils.LoadJSON(filepath, &testCases)
25+
var _, err = utils.LoadJSON(filepath, &TwoDArrayTestCases)
2626
if err != nil {
2727
t.Log(err)
2828
}
2929
}
3030

31-
func Test2DArray(t *testing.T) {
31+
func TestTwoDArray(t *testing.T) {
3232

33-
setupSuite(t)
33+
twoDArraySetupSuite(t)
3434

35-
for _, tt := range testCases {
35+
for _, tt := range TwoDArrayTestCases {
3636
testname := fmt.Sprintf("hourglassSum(%v) => %v \n", tt.Input, tt.Expected)
3737
t.Run(testname, func(t *testing.T) {
3838

0 commit comments

Comments
 (0)