Updoc

From Erights

(Difference between revisions)
Jump to: navigation, search
(this is a stub, but I had to put something)
(add printing spec)
Line 1: Line 1:
''Updoc'' is a tool for creating checkable documentation and regression tests.   
''Updoc'' is a tool for creating checkable documentation and regression tests.   
-
Please read more about it here:
+
Please read more about it here: http://www.erights.org/elang/tools/updoc.html
-
http://www.erights.org/elang/tools/updoc.html
+
==[[:Category:E specification|E specification]]==
 +
 
 +
The E specification contained in this wiki incorporates a test suite written in Updoc.
 +
 
 +
==Updoc syntax and behavior==
 +
 
 +
{{XXX|write the rest of this}}
 +
 
 +
An updoc test failure occurs when the actual answers resulting from evaluation  are not equal (except for stack traces) to the expected answers written in the test script.
 +
 
 +
===Printing===
 +
 
 +
In the Updoc [[environment]], the text printed via the output objects <code>stdout</code>, <code>stderr</code>, <code>print</code>, and <code>println</code> is part of the results checked.
 +
 
 +
Semantics: stdout and stderr write to separate buffers. At the following times in the execution of each step, the contents of each buffer, if nonempty, are moved into answers named "stdout" and "stderr":
 +
* after evaluation of the step, but before the <code>value</code> is printed
 +
* after interp.waitAtTop/blockAtTop pauses and after all turns queued by the step have executed, but before the evaluation of the next step
 +
 
 +
{{XXX|Review whether this definition matches E-on-CL and E-on-Java}}
 +
 
 +
? stdout.print("a")
 +
# stdout: a
 +
 +
? stdout.print("a\n")
 +
# stdout: a
 +
#       
 +
 +
? stdout.print("a"); stderr.print("b")
 +
# stdout: a
 +
 +
# stderr: b
 +
 +
? stdout.print("a"); stdout <- print("b"); "c"
 +
# stdout: a
 +
 +
# value: "c"
 +
 +
# stdout: c
 +
 
 +
{{stub}}
 +
[[Category:E specification]]

Revision as of 23:23, 2 July 2009

Updoc is a tool for creating checkable documentation and regression tests.

Please read more about it here: http://www.erights.org/elang/tools/updoc.html

E specification

The E specification contained in this wiki incorporates a test suite written in Updoc.

Updoc syntax and behavior

XXX write the rest of this

An updoc test failure occurs when the actual answers resulting from evaluation are not equal (except for stack traces) to the expected answers written in the test script.

Printing

In the Updoc environment, the text printed via the output objects stdout, stderr, print, and println is part of the results checked.

Semantics: stdout and stderr write to separate buffers. At the following times in the execution of each step, the contents of each buffer, if nonempty, are moved into answers named "stdout" and "stderr":

  • after evaluation of the step, but before the value is printed
  • after interp.waitAtTop/blockAtTop pauses and after all turns queued by the step have executed, but before the evaluation of the next step

XXX Review whether this definition matches E-on-CL and E-on-Java

? stdout.print("a")
# stdout: a

? stdout.print("a\n")
# stdout: a
#         

? stdout.print("a"); stderr.print("b")
# stdout: a

# stderr: b

? stdout.print("a"); stdout <- print("b"); "c"
# stdout: a

# value: "c"

# stdout: c
This page is a stub; it should be expanded with more information. If doing so, check the original E web site and the mailing list archives for content which could be moved into this page.
Personal tools
more tools