2016-09-16 14:25 GMT+02:00 Nicolai Hess <nicolaih...@gmail.com>: > > > 2016-09-16 13:42 GMT+02:00 Clément Bera <bera.clem...@gmail.com>: > >> Why don't you just change nautilus to have two text areas, one with the >> test corresponding to the method and the other one with the method's code ? >> >> You're saying: >> *Their values is active documentation that can be automatically >> validated.* >> That can also be applied to test we've already had with SUnit. If the >> only difference you want is to display the test next to the method, then >> it's an IDE problem, nothing has to be changed but the IDE. >> > > This is what I thought first, we already have the association between > methods and tests, Nautilus can detect if there > is a corresponding test , for example browse Fraction>>truncated, it will > show a test icon, that will run the test FractionTest>>#testTruncated. > This works already good, and I think we don't need special comments or > pragmas for this. > > But what stef wants is > 1. Method docs with examples, so a user can see an example usage of a > method (sunit test methods sometimes aren't good "examples") >
I'd prefer to have a Pillar doc for my class / package / project with live code portions, with a link method to chapter. We use examples inside comments because we don't have anything better... > 2. We already had (and still have) some method docs where the example code > just won't work anymore because the methods or classes used > by the example were removed, renamed. So, it would be good if we can > extract these examples and run them automatically to make sure they > are still working. > This one is independant of the syntax. If they are in, say, the Pillar description of the class, of course they can be tested and run everytime we save a new version of the package ? Or as a test case? What about examples that create views, windows and external files? How do we test they are still valid without making those a sunit test with a teardown? > > But yes, maybe we can still solve this with better Tools, not working only > on the plain text in comments. > Exactly. Moreover given what we're focusing on with GT. Thierry