-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
28 lines (28 loc) · 1.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<script type="text/javascript" src="Mineral.js"></script>
<script type="text/javascript">
function js_tests() {
var tests = evaluate(expand(parse(normalize("tests"))));
for(var i = 0; i < tests.length; i++) {
var number = tests[i], code = stringify(tests[++i]), expected = stringify(tests[++i]);
var response = interpret(code);
if(expected.charAt(0) == '"' && code.charAt(0) != '"') response = stringify(response);
if(response == expected)
console.log(number + ": '" + code + "'' -> '" + response + "'");
else
console.error(number + ": '" + code + "'' yields '" + response + "'' instead of '" + expected + "'");
}
}
</script>
</head>
<body onload="loadFiles('mrl/core.mrl', 'mrl/mineral-console.mrl', 'mrl/tests.mrl')">
<textarea rows=15 cols=100 id="mineralConsole"
onKeyPress="mineral.process_command()"
onKeyDown="mineral.insert_last_command()"
style="background: #444;
color: #bfb;
font-family: 'Courier New';
font-size: 0.8em;">> </textarea>
</body>
</html>