Created
October 16, 2015 05:15
-
-
Save deathbeam/db7549e392f29083afa2 to your computer and use it in GitHub Desktop.
Maybe new syntax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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