Skip to content

Commit aeb4a9c

Browse files
mikehquan19jpahm
authored andcommitted
Add unit test for validator
1 parent 207f87e commit aeb4a9c

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

parser/validator_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ var testProfessors []*schema.Professor
2121
// Map used to map index of test sections to test courses
2222
var indexMap map[int]int
2323

24-
// Main to upload the test data
25-
func TestMain(m *testing.M) {
24+
func init() {
2625
// parse the test courses
2726
data, err := os.ReadFile("./testdata/courses.json")
2827
if err != nil {
@@ -53,11 +52,7 @@ func TestMain(m *testing.M) {
5352
panic(err)
5453
}
5554

56-
// map
5755
indexMap = map[int]int{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 4}
58-
59-
testRun := m.Run()
60-
os.Exit(testRun)
6156
}
6257

6358
// Test duplicate courses. Designed for fail cases

0 commit comments

Comments
 (0)