diff --git a/test.html b/test.html new file mode 100644 index 00000000..05239c26 --- /dev/null +++ b/test.html @@ -0,0 +1,66 @@ + +CoffeeScript Test Suite +

+
+
diff --git a/test/test_compilation.coffee b/test/test_compilation.coffee
index 9e1c4501..0bdf7986 100644
--- a/test/test_compilation.coffee
+++ b/test/test_compilation.coffee
@@ -1,19 +1,11 @@
 # Ensure that carriage returns don't break compilation on Windows.
-js = CoffeeScript.compile("one\r\ntwo", {wrap: off})
+eq CoffeeScript.compile('one\r\ntwo', wrap: off), 'one;\ntwo;'
 
-ok js is "one;\ntwo;"
+# `globals: on` removes `var`s
+eq CoffeeScript.compile('x = y', wrap: off, globals: on), 'x = y;'
 
-
-global.resultArray = []
-CoffeeScript.run("resultArray.push i for i of global", {wrap: off, globals: on, fileName: 'tests'})
-
-ok 'setInterval' in global.resultArray
-
-ok 'passed' is CoffeeScript.eval '"passed"', wrap: off, globals: on, fileName: 'tests'
+ok 'passed' is CoffeeScript.eval '"passed"', wrap: off, fileName: 'test'
 
 #750
-try
-  CoffeeScript.nodes 'f(->'
-  ok no
-catch e
-  eq e.message, 'unclosed CALL_START on line 1'
+try ok not CoffeeScript.nodes 'f(->'
+catch e then eq e.message, 'unclosed CALL_START on line 1'
diff --git a/test/test_existence.coffee b/test/test_existence.coffee
index d012361a..3b2b2c6a 100644
--- a/test/test_existence.coffee
+++ b/test/test_existence.coffee
@@ -60,7 +60,7 @@ eq value?.toString().toLowerCase(), undefined
 value = 10
 eq value?.toString().toLowerCase(), '10'
 
-eq process.exit.nothing?.property() or 101, 101
+eq 0.nothing?.property() or 101, 101
 
 counter = 0
 func = ->
diff --git a/test/test_functions.coffee b/test/test_functions.coffee
index 6d566615..e967965b 100644
--- a/test/test_functions.coffee
+++ b/test/test_functions.coffee
@@ -22,16 +22,16 @@ obj = {
   name: 'Fred'
 
   bound: ->
-    (=> ok(this.name is 'Fred'))()
+    (=> eq this, obj)()
 
   unbound: ->
-    (-> ok(!this.name?))()
+    (-> ok this isnt obj)()
 
   nested: ->
     (=>
       (=>
         (=>
-          ok this.name is 'Fred'
+          eq this, obj
         )()
       )()
     )()