Closed d-torrance closed 2 years ago
We can kind of do this now, but it's ugly:
i4 : (Core#"test inputs"#0)_{0,1}
o4 = {/usr/share/doc/Macaulay2/Core/tests/0-homog.m2, 1}
Plus it would be nice if we knew more information than just the line number, like the output of locate
. This could be used by edit
, code
, etc.
And perhaps, if something like code_0 Core
worked to read the file and get the code of a test, then we could dispense with storing a bunch of strings containing test code in memory and just grab them as we need them.
Could have a function like examples
, perhaps tests
, that returns something like that.
You always know the test number before the failure occurs, why not add a helper function to tell you the test location given the test number so you can debug it? Then you can add a method to
edit
, or perhaps a new functioneditTest
orviewTest
so you can automatically open an editor to that location.Originally posted by @mahrud in https://github.com/Macaulay2/M2/issues/1762#issuecomment-752702567