~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to test/js/test-harness.js

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
var modules = {};
2
 
var require = function (moduleName) {
3
 
    if (modules[moduleName] == undefined) {
4
 
        var module = {};
5
 
        var exports = {};
6
 
        eval (readFile (moduleName.replace(/\./g, "/") + ".js"));
7
 
        modules[moduleName] = exports;
8
 
    }
9
 
    return modules[moduleName];
10
 
};
11
 
var module = {};
12
 
var exports = {};
13
 
var visitor = {
14
 
    "ε": function () {},
15
 
    "_,_": function (ts,us) { ts(visitor); us(visitor); },
16
 
    "assert": function (b,ok,msg) { 
17
 
        if (b) {
18
 
            print("OK " + msg);
19
 
        } else {
20
 
            print("FAIL " + msg); 
21
 
            java.lang.System.exit(1); 
22
 
        }
23
 
    }
24
 
};
25
 
eval(readFile(arguments[0]));
26
 
print ("-- " + module.id + " --");
27
 
exports.tests()(visitor);