repl tests in place; checking deviations now.

This commit is contained in:
Danny Yoo 2013-04-18 12:10:17 -06:00
parent 53adccebfc
commit 602f27ef4e
3 changed files with 13 additions and 10 deletions

View File

@ -173,7 +173,6 @@
subelts.push(params.recur(p));
}
if (params.getMode() === 'constructor') {
if (dottedPair) {
node = subelts[subelts.length - 1];

View File

@ -13,8 +13,9 @@
<p>This page tests the behavior of REPL compilation.</p>
<div id="is-running"></div>
<br/>
<div id="failure-index">Failures: </div>
<br/>
</body>
</html>

View File

@ -11,7 +11,7 @@ jQuery(document).ready(function() {
failureCount++;
$("#failure-index").css("display", "inline");
$("#failure-index").append($("<a/>").attr("href", "#fail" + failureCount)
.text("" + failureCount));
.text("" + failureCount)).append(' ');
var failMsgText = " FAIL" + ((e.message || e || '') ?
": " + (e.message || e || '') : "");
$(document.body).append($("<span/>").text(failMsgText)
@ -46,16 +46,16 @@ jQuery(document).ready(function() {
};
var runAsyncTest = function(name, f, k) {
repl.display("running " + name + "... ");
$(document.body).append("running " + name + "... ");
var success = function() {
repl.display(" ok\n")
$(document.body).append(" ok").append($("<br/>"));
k();
};
var fail = function(e) {
noteRedFailure(e);
repl.display("\n");
repl.display(e + '');
repl.display('\n');
$(document.body).append($("<br/>"));
// $(document.body).append(e + '');
//$(document.body).append($("<br/>"));
k();
};
try {
@ -69,10 +69,13 @@ jQuery(document).ready(function() {
var queueTest = function(name, code, expectedText) {
queueAsyncTest(name, function(success, fail) {
var checkOutput = function(err) {
if (outputSpan.text() === expectedText) {
var observedText = outputSpan.text().replace(/\n$/, "");
if (observedText === expectedText) {
success();
} else {
fail("not the same: " + outputSpan.text() +
console.log(err);
console.log(observedText, expectedText);
fail("not the same: " + observedText +
", " +
expectedText);
}