exercism / fortran

Exercism exercises in Fortran.
https://exercism.org/tracks/fortran
MIT License
23 stars 30 forks source link

Do not double-count failed tests on integer arrays #226

Closed simisc closed 1 year ago

simisc commented 1 year ago

The subroutine assert_equal_int_arr calls test_fail_msg twice when testing an array of incorrect size. This results in double-counting of failed tests, as shown in the test summary.

Example

Testing incorrect solutions to the High Scores exercise

Before

When size is correct but contents are incorrect:

1:  ERROR: Test 8: Personal top when there is only one
1:  ERROR: Expected < 40           0           0 > but got < 99           0           0 >
1:  Test summary: 5 of 8 tests failed

When size is incorrect:

1:  ERROR: Test 8: Personal top when there is only one
1:  ERROR: Arrays are not the same size!
1:  ERROR: Expected < 40           0           0 > but got < 40           0 >
1:  ERROR: Test 8: Personal top when there is only one
1:  ERROR: Expected < 40           0           0 > but got < 40           0 >
1:  Test summary: 10 of 8 tests failed

After

When size is correct but contents are incorrect:

1:  ERROR: Test 8: Personal top when there is only one
1:  ERROR: Expected < 40           0           0 > but got < 99           0           0 >
1:  Test summary: 5 of 8 tests failed

When size is incorrect:

1:  ERROR: Test 8: Personal top when there is only one
1:  ERROR: Arrays are not the same size!
1:  ERROR: Expected < 40           0           0 > but got < 40           0 >
1:  Test summary: 5 of 8 tests failed