Commit b5f0008
committed
Initializing various ws definitions in SetupSuite
Instead of parsing and creating the various ws definitions used for testing during file initialization, doing this work in SetupSuite. This makes it easier to see parsing errors, and pinpoint where they come from. Which is handy as we work on the parser! Before this change, a panic in `MustNewDefinitions` would yield
panic: test
goroutine 1 [running]:
github.com/helloeave/worksheets.MustNewDefinitions(0x156a760, 0xc4201ac1a0, 0x0, 0x0, 0x0, 0xc4200943d0)
/Users/pascal/Development/go/src/github.com/helloeave/worksheets/worksheets.go:109 +0x39
FAIL github.com/helloeave/worksheets 0.018s
ok github.com/helloeave/worksheets/tools (cached)
whereas now it yields
--- FAIL: TestRunAllTheDbTests (0.00s)
panic: test [recovered]
panic: test
goroutine 5 [running]:
testing.tRunner.func1(0xc4201942d0)
/usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:742 +0x29d
panic(0x1457a40, 0x1568b00)
/usr/local/Cellar/go/1.10/libexec/src/runtime/panic.go:505 +0x229
github.com/helloeave/worksheets.MustNewDefinitions(0x156b1a0, 0xc420196240, 0x0, 0x0, 0x0, 0x1)
/Users/pascal/Development/go/src/github.com/helloeave/worksheets/worksheets.go:109 +0x39
github.com/helloeave/worksheets.newAllDefs(0x0, 0x0, 0x0, 0x0, 0x0)
/Users/pascal/Development/go/src/github.com/helloeave/worksheets/testutil_test.go:83 +0xec
github.com/helloeave/worksheets.(*DbZuite).SetupSuite(0xc4200a18b0)
/Users/pascal/Development/go/src/github.com/helloeave/worksheets/dbtestutil_test.go:35 +0x26
github.com/stretchr/testify/suite.Run(0xc4201942d0, 0x156cda0, 0xc4200a18b0)
/Users/pascal/Development/go/src/github.com/stretchr/testify/suite/suite.go:64 +0x588
github.com/helloeave/worksheets.TestRunAllTheDbTests(0xc4201942d0)
/Users/pascal/Development/go/src/github.com/helloeave/worksheets/dbtestutil_test.go:86 +0x51
testing.tRunner(0xc4201942d0, 0x152c7b8)
/usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
created by testing.(*T).Run
/usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
which properly identifies `dbtestutil_test.go:86` as the culprit.1 parent 075bcfc commit b5f0008
File tree
11 files changed
+146
-122
lines changed11 files changed
+146
-122
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | | - | |
29 | | - | |
| 26 | + | |
30 | 27 | | |
31 | 28 | | |
32 | | - | |
| 29 | + | |
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
| |||
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
50 | | - | |
51 | | - | |
| 47 | + | |
| 48 | + | |
52 | 49 | | |
53 | 50 | | |
54 | 51 | | |
| |||
84 | 81 | | |
85 | 82 | | |
86 | 83 | | |
87 | | - | |
88 | | - | |
| 84 | + | |
| 85 | + | |
89 | 86 | | |
90 | 87 | | |
91 | 88 | | |
| |||
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
134 | | - | |
| 131 | + | |
135 | 132 | | |
136 | 133 | | |
137 | 134 | | |
| |||
170 | 167 | | |
171 | 168 | | |
172 | 169 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
177 | 174 | | |
178 | 175 | | |
179 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
340 | | - | |
| 340 | + | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
344 | | - | |
| 343 | + | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
| |||
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
411 | 413 | | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
415 | 417 | | |
416 | | - | |
| 418 | + | |
417 | 419 | | |
418 | 420 | | |
419 | | - | |
420 | | - | |
421 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
422 | 424 | | |
423 | 425 | | |
424 | 426 | | |
| |||
454 | 456 | | |
455 | 457 | | |
456 | 458 | | |
457 | | - | |
| 459 | + | |
458 | 460 | | |
459 | 461 | | |
460 | 462 | | |
461 | | - | |
| 463 | + | |
462 | 464 | | |
463 | 465 | | |
464 | 466 | | |
465 | 467 | | |
466 | | - | |
| 468 | + | |
467 | 469 | | |
468 | 470 | | |
469 | 471 | | |
| |||
476 | 478 | | |
477 | 479 | | |
478 | 480 | | |
479 | | - | |
| 481 | + | |
480 | 482 | | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
486 | 488 | | |
487 | | - | |
| 489 | + | |
488 | 490 | | |
489 | | - | |
| 491 | + | |
490 | 492 | | |
491 | 493 | | |
492 | 494 | | |
| |||
543 | 545 | | |
544 | 546 | | |
545 | 547 | | |
546 | | - | |
| 548 | + | |
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
| |||
552 | 554 | | |
553 | 555 | | |
554 | 556 | | |
555 | | - | |
| 557 | + | |
556 | 558 | | |
557 | | - | |
| 559 | + | |
558 | 560 | | |
559 | | - | |
| 561 | + | |
560 | 562 | | |
561 | 563 | | |
562 | 564 | | |
| |||
611 | 613 | | |
612 | 614 | | |
613 | 615 | | |
614 | | - | |
| 616 | + | |
615 | 617 | | |
616 | 618 | | |
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
620 | 622 | | |
621 | 623 | | |
622 | | - | |
| 624 | + | |
623 | 625 | | |
624 | | - | |
| 626 | + | |
625 | 627 | | |
626 | 628 | | |
627 | 629 | | |
| |||
648 | 650 | | |
649 | 651 | | |
650 | 652 | | |
651 | | - | |
| 653 | + | |
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
| |||
696 | 698 | | |
697 | 699 | | |
698 | 700 | | |
699 | | - | |
| 701 | + | |
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
703 | 705 | | |
704 | 706 | | |
705 | 707 | | |
706 | | - | |
| 708 | + | |
707 | 709 | | |
708 | 710 | | |
709 | | - | |
| 711 | + | |
710 | 712 | | |
711 | 713 | | |
712 | 714 | | |
| |||
751 | 753 | | |
752 | 754 | | |
753 | 755 | | |
754 | | - | |
| 756 | + | |
755 | 757 | | |
756 | 758 | | |
757 | 759 | | |
| |||
760 | 762 | | |
761 | 763 | | |
762 | 764 | | |
763 | | - | |
764 | | - | |
765 | | - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
766 | 768 | | |
767 | 769 | | |
768 | 770 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
42 | | - | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
| 19 | + | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
33 | | - | |
| 31 | + | |
34 | 32 | | |
35 | 33 | | |
36 | 34 | | |
| |||
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
42 | | - | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
64 | | - | |
| 61 | + | |
| 62 | + | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
0 commit comments