Skip to main content

Haxe

Status

Beta

Versions

4.0

Test Frameworks

utest

Example

src/Solution.hx

class Example {
  public static function add(a:Int, b:Int):Int {
    return a + b;
  }
}
class Example {
  public static function add(a:Int, b:Int):Int {
    return a + b;
  }
}

tests/SolutionTest.hx

import utest.Assert;
import Solution;

class SolutionTest extends utest.Test {
  function testExample() {
    Assert.equals(2, Example.add(1, 1));
  }
}
import utest.Assert;
import Solution;

class SolutionTest extends utest.Test {
  function testExample() {
    Assert.equals(2, Example.add(1, 1));
  }
}

The name of the test class must be SolutionTest.

The optional preloaded code is a separate module (src/Preloaded.hx) that you can import.

Timeout

12 seconds

Packages

None

Services

None

Language ID

haxe