Skip to content

Commit

Permalink
testing: add some tests for types
Browse files Browse the repository at this point in the history
  • Loading branch information
StaffanB committed Jun 16, 2011
1 parent 917101d commit d2bc8db
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtests.html
Expand Up @@ -51,6 +51,7 @@
<script src="src/Test/datatypes.js"></script>
<script src="src/Test/fixity.js"></script>
<script src="src/Test/composition.js"></script>
<script src="src/Test/types.js"></script>

<script src="test/testing.js"></script>

Expand Down
28 changes: 28 additions & 0 deletions src/Test/types.js
@@ -0,0 +1,28 @@
JSHC.Test.Tests.types = function(tester){
var cases = {};

cases.t1 = {
fileSystem: {
"T1": "module T1 where\n"+
"x = x\n"+
"y = \\ z -> x\n"+
"z = \\ x -> x\n"
},
commands: {
":type x": "forall a. a",
":type y": "forall a b. (a -> b)",
":type z": "forall a. (a -> a)",

// check type of "Prelude.id".
":type id": "forall a. (a -> a)",
}
}

for(var cname in cases){
JSHC.Test.runData(tester,
{name: "types-"+cname,
errors: 0,
fileSystem: cases[cname].fileSystem,
commands: cases[cname].commands});
}
};

0 comments on commit d2bc8db

Please sign in to comment.