Document how expect_exact works through an error message
This commit is contained in:
parent
516298fa5f
commit
9f0b66ed20
|
|
@ -168,6 +168,10 @@ function parse_test(file) {
|
||||||
else if (stat.body.length == 0) stat = new U.AST_EmptyStatement();
|
else if (stat.body.length == 0) stat = new U.AST_EmptyStatement();
|
||||||
}
|
}
|
||||||
if (node.label.name === "expect_exact") {
|
if (node.label.name === "expect_exact") {
|
||||||
|
if (!(stat.TYPE === "SimpleStatement" && stat.body.TYPE === "String")) {
|
||||||
|
throw new Error("The value of the expect_exact clause should be a string! " +
|
||||||
|
"Like this: `expect_exact: \"some.exact.javascript;\"`");
|
||||||
|
}
|
||||||
test[node.label.name] = stat.body.start.value
|
test[node.label.name] = stat.body.start.value
|
||||||
} else {
|
} else {
|
||||||
test[node.label.name] = stat;
|
test[node.label.name] = stat;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user