in the middle of getting the repl tests in place.

This commit is contained in:
Danny Yoo 2013-04-18 11:43:01 -06:00
parent c6b89c6a2e
commit 53adccebfc
4 changed files with 4325 additions and 4 deletions

View File

@ -42,7 +42,6 @@
node.append(params.recur(this._fields[i])); node.append(params.recur(this._fields[i]));
} }
node.append($('<span/>').text(")").addClass('rParen')); node.append($('<span/>').text(")").addClass('rParen'));
console.log(node);
return node.get(0); return node.get(0);
}; };

View File

@ -172,7 +172,7 @@
results.push(that.M.e[that.M.e.length - 1 - i]); results.push(that.M.e[that.M.e.length - 1 - i]);
} }
for (i = 0; i < results.length; i++) { for (i = 0; i < results.length; i++) {
print(that, results[i]); that.printlnIgnoringVoid(results[i]);
}; };
k(); k();
}; };
@ -204,10 +204,11 @@
}; };
// Print: Repl racket-value -> void // printlnIgnoringVoid: racket-value -> void
// Prints the racket value out, followed by a newline, // Prints the racket value out, followed by a newline,
// unless VOID is being printed. // unless VOID is being printed.
var print = function(that, elt) { Repl.prototype.printlnIgnoringVoid = function(elt) {
var that = this;
var outputPort = that.M.params.currentOutputPort; var outputPort = that.M.params.currentOutputPort;
if (elt !== plt.runtime.VOID) { if (elt !== plt.runtime.VOID) {
outputPort.writeDomNode( outputPort.writeDomNode(
@ -218,6 +219,26 @@
} }
}; };
// print: racket-value -> void
Repl.prototype.print = function(elt) {
var that = this;
var outputPort = that.M.params.currentOutputPort;
outputPort.writeDomNode(
that.M,
plt.runtime.toDomNode(elt, that.M.params['print-mode']));
};
// println: racket-value -> void
// Displays the racket value out, followed by a newline,
Repl.prototype.display = function(elt) {
var that = this;
var outputPort = that.M.params.currentOutputPort;
outputPort.writeDomNode(
that.M,
plt.runtime.toDomNode(elt, 'display'));
};
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<script src="collects/runtime.js"></script>
<script src="collects/library.js"></script>
<script src="easyXDM-min.js"></script>
<script src="repl.js"></script>
<script src="tests.js"></script>
</head>
<body>
<h1>Repl tests</h1>
<p>This page tests the behavior of REPL compilation.</p>
<div id="is-running"></div>
<div id="failure-index">Failures: </div>
</body>
</html>

File diff suppressed because it is too large Load Diff