On Mon, 26 Jan 2009 at 10:11PM -0800, Robert Bradshaw wrote: > I'm all for keeping doctests as local as possible--it would be nice > to put the test for sage -preparse in the sage-preparse file itself. > We could add a line to sage -testall to run tests in this directory > as well.
I would also like to keep tests as local as possible. If the tests are right in the file, then when someone fixes a bug, they can add a test to prevent a regression. If the tests are way over in some other file, people will forget to update the tests. The function that is responsible for #5052 (do_load_and_attach()) basically takes a string and returns a string, so it would be no problem doing doctesting outside of the context of actually preparsing a file on disk. Some functions work this way, some don't. What I'd like is, for those functions that can easily be doctested, to just add an EXAMPLES or TESTS stanza, just like with Sage library code. If we do that, how hard would it be to have the usual testing framework find files with such tests and run them? OTOH, I do like William's high level testing, where we just run os.system('sage -preparse ...') and make sure something reasonable happens. More testing == more better? Dan -- --- Dan Drake <dr...@kaist.edu> ----- KAIST Department of Mathematical Sciences ------- http://mathsci.kaist.ac.kr/~drake
signature.asc
Description: Digital signature