Skip to content

Instantly share code, notes, and snippets.

@deathbeam
Created October 16, 2015 05:15
Show Gist options
  • Save deathbeam/db7549e392f29083afa2 to your computer and use it in GitHub Desktop.
Save deathbeam/db7549e392f29083afa2 to your computer and use it in GitHub Desktop.
Maybe new syntax
import haxe.unit.TestCase
import haxe.unit.TestRunner
module self
def main = () =>
def r = TestRunner.new()
r.add(MyTests.new())
r.run()
class MyTests < TestCase
def myVal : String
def myInt : Int
override def setup = () =>
myVal = "foo"
myInt = 1 + 1
-- Every test function name has to start with 'test'
def testValue = () => assertEquals("foo", myVal)
def testMath1 = () => assertTrue(myInt == 2)
def testMath2 = () => assertFalse(myInt == 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment