summaryrefslogtreecommitdiff
path: root/INTERPRETING.md
diff options
context:
space:
mode:
authorMike Pennisi <mike@mikepennisi.com>2016-03-13 13:26:10 -0400
committerMike Pennisi <mike@mikepennisi.com>2016-10-19 15:24:21 -0400
commit0d4a07ba8c179551fde110a738241da69217db52 (patch)
tree824dfff037fe83eb8046adb25b06659dbd026a10 /INTERPRETING.md
parent2915fe8527d06c2cb1a4780eeac37ef743c02d9f (diff)
downloadqtdeclarative-testsuites-0d4a07ba8c179551fde110a738241da69217db52.tar.gz
Update documentation
Diffstat (limited to 'INTERPRETING.md')
-rw-r--r--INTERPRETING.md28
1 files changed, 23 insertions, 5 deletions
diff --git a/INTERPRETING.md b/INTERPRETING.md
index da51fcee3..e1f892df4 100644
--- a/INTERPRETING.md
+++ b/INTERPRETING.md
@@ -117,20 +117,38 @@ structured as [YAML](http://yaml.org/).
### `negative`
These tests are expected to generate an uncaught exception. The value of this
-attribute is the name of the constructor of the expected error. If a test
-configured with the `negative` attribute completes without throwing an
-exception, or if the name of the thrown exception's constructor does not match
-the specified constructor name, the test must be interpreted as "failing."
+attribute is a YAML dictonary with two keys:
+
+- `phase` - the stage of the test interpretation process that the error is
+ expected to be produced; either "early" (meaning, "prior to evaluation") or
+ "runtime" (meaning, "during evaluation"); in the case of "early", additional
+ test transformation may be required--see below
+- `type` - the name of the constructor of the expected error
+
+If a test configured with the `negative` attribute completes without throwing
+an exception, or if the name of the thrown exception's constructor does not
+match the specified constructor name, or if the error occurs at a phase that
+differs from the indicated phase, the test must be interpreted as "failing."
*Example:*
```js
/*---
-negative: ReferenceError
+negative:
+ phase: runtime
+ type: ReferenceError
---*/
unresolvable;
```
+Consumers are free to assert the "early" phase as they see fit.
+
+For example, it is possible to insert a `throw` statement with a unique error
+type at the beginning of the test file. In this case, the statement should be
+inserted *after* the directive desribed in the section titled "Strict Mode"
+(where appropriate), though it must *not* be inserted for tests containing the
+"raw" flag.
+
### `includes`
One or more files whose content must be evaluated in the test realm's global