Skip to content

Torque3D-Resources/tasman

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Tasman

A TorqueScript testing framework for T3D inspired by Jasmine.

Example

// Declare a new test suite for MyObject.
test(MyObject);

// Set up before each test.
function MyObjectTests::before() {
   new ScriptObject(MyObject) {
      property = "foo";
   };
}

// And pull everything down afterwards!
function MyObjectTests::after() {
   MyObject.delete();
}

// A basic test - expect that the setup works correctly!
function MyObjectShould::exist() {
   expect(MyObject).toExist();
}

// More advanced matchers.
function MyObjectShould::have_a_property() {
   expect(MyObject.property).toHave(1).word();
   expect(MyObject.property).toEqual("foo");
   expect(MyObject.property).not().toEqual("bar");
}

The output should look something like:

Tasman test output all passed

Now let's introuce a failure:

function MyObjectShould::do_something_silly() {
   expect(MyObject.property).toBeAVector(3);
}

And the output becomes:

Tasman test output one failed

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%