You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: parser/parser_test.go
+5-8Lines changed: 5 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ import (
21
21
"go.mongodb.org/mongo-driver/bson/primitive"
22
22
)
23
23
24
+
// TestData bundles a parser test input with its expected artifacts.
24
25
typeTestDatastruct {
25
26
Inputstring
26
27
RowInfomap[string]*goquery.Selection
@@ -33,14 +34,7 @@ type TestData struct {
33
34
// testData global dictionary containing the data from /testdata by folder name
34
35
vartestDatamap[string]TestData
35
36
36
-
// TestMain entry point for all tests in the parser package.
37
-
// The function will load `./testdata` into memory before running
38
-
// the tests so that test can run in parallel.
39
-
//
40
-
// You can optionally provide the flag `update`, which will run
41
-
// updateTestData. Example usage
42
-
//
43
-
// `go test -v ./parser -args -update`
37
+
// TestMain loads parser fixtures and handles the -update flag for regenerating expectations.
44
38
funcTestMain(m*testing.M) {
45
39
update:=flag.Bool("update", false, "Regenerates the expected output for the provided test inputs. Should only be used when you are 100% sure your code is correct! It will make all test pass :)")
46
40
@@ -247,6 +241,7 @@ func clearGlobals() {
247
241
ReqParsers=make(map[primitive.ObjectID]func())
248
242
}
249
243
244
+
// TestParse verifies that parsing input fixtures generates the expected JSON exports.
250
245
funcTestParse(t*testing.T) {
251
246
tempDir:=t.TempDir()
252
247
// todo fix grade data, csvPath = ./grade-data panics
0 commit comments