exercism / fortran

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

Truncate long arrays in failed test report #227

Closed simisc closed 1 year ago

simisc commented 1 year ago

When the actual or the expected result is too long, ia_to_s causes a Fortran runtime error: End of record (reported in this forum post).

After these changes, each array element has its minimum width instead of the default 12 characters. If the resulting string is still too long, it is truncated and the truncation is indicated with .

Examples

High scores

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,0,0,0,0,0,0,0,0,0,… >
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,10000,10000,10000,… >

Sieve

1:  ERROR: Test 5: find primes up to 1000
1:  ERROR: Arrays are not the same size!
1:  ERROR: Expected < 2,3,5,7,11,13,17,19,23,… > but got < 2,3,4,5,6,7,8,9,10,11,… >
1:  ERROR: Test 5: find primes up to 1000
1:  ERROR: Expected < 2,3,5,7,11,13,17,19,23,… > but got < 2,999,5,7,11,13,17,19,… >

Saddle Points

1:  ERROR: Test 9: Can identify that saddle points in a single row matrix are those with the maximum value
1:  ERROR: Arrays are not the same size!
1:  ERROR: Expected < (1,2),(1,4) > but got < (4,4),(4,4),(4,4),(4,4),… >