|
Qore QUnit Module Reference
0.3
|
A class representing a test with injected dependencies. More...

Public Member Functions | |
| setScriptPath (*string testedFile) | |
| A helper function. It must be called once for a new instance with get_script_path() as argument. | |
| setUp () | |
| A prototype function. | |
Public Member Functions inherited from QUnit::Test | |
| addTestCase (string name, code call, *softlist< auto > args) | |
| adds a test case to run More... | |
| addTestCase (QUnit::TestCase tc) | |
| adds a test case to run More... | |
| assertEq (auto expected, auto actual, *string name) | |
| Tests a value for equality to an expected value with hard comparisons (types and values must be identical) More... | |
| assertEqSoft (auto expected, auto actual, *string name) | |
| Tests a value for equality to an expected value with soft comparisons (types may differ) More... | |
| assertFalse (auto actual, *string name) | |
| Tests a boolean value. More... | |
| assertFloatEq (float expected, float actual, float epsilon=0.0000000001, *string name) | |
| Tests a float value for equality to an expected value with an allowed error. More... | |
| assertNumberEq (number expected, number actual, number epsilon=0.0000000001, *string name) | |
| Tests a number value for equality to an expected value with an allowed error. More... | |
| assertSkip (*string name) | |
| Skips assertion on purpose. More... | |
| assertThrows (string expectedErr, *string expectedDesc, code theCode, *softlist< auto > args, *string name) | |
| Tests that a piece of code throws an exception with given description. More... | |
| assertThrows (string expectedErr, code theCode, *softlist< auto > args, *string name) | |
| Tests that a piece of code throws an exception. More... | |
| assertTrue (auto actual, *string name) | |
| Tests a boolean value. More... | |
| constructor (string name, string version, *reference< list< string >> p_argv, *hash opts) | |
| creates the object and sets the name of the test | |
| bool | equals (auto a, auto b) |
| Compare two values for equality. More... | |
| bool | equalsIterated (AbstractIterator a, AbstractIterator b) |
| Compare two iterables, item by item, for equality of each index. More... | |
| fail (*string msg) | |
| Fails the test unconditionally. More... | |
| *string | getEnv (string key, *string def) |
| facade for the system environment variables | |
| TestCase | getTestCase (string meth) |
| returns the current test case | |
| globalSetUp () | |
| global setup; will be called once before tests are run | |
| globalTearDown () | |
| global tear down; will be called once after all tests are run | |
| int | main () |
| Run the whole suite, report results. | |
| bool | notEquals (auto a, auto b) |
| Compare two values for inequality. More... | |
| string | printUnexpectedData (auto exp, auto act, *bool neg, *bool soft_comparisons) |
| Helper function for printing out human-readable comparison of two values. | |
| bool | regexpMatches (string s, string regexp) |
| Compare a string for match against a regexp. More... | |
| setUp () | |
| Prototype function for setting up test environment. It will be called for each test individually. | |
| tearDown () | |
| Prototype function for cleaning up test environemnt. It will be called after each test has executed. | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, int expectedResultValue) |
| Tests for a single assertion for a call returning an integer value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, float expectedResultValue) |
| Tests for a single assertion for a call returning a floating-point value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, number expectedResultValue) |
| Tests for a single assertion for a call returning an arbitrary-precision numeric value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, bool expectedResultValue) |
| Tests for a single assertion for a call returning a boolean value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, string expectedResultValue) |
| Tests for a single assertion for a call returning a string value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, date expectedResultValue) |
| Tests for a single assertion for a call returning a date value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, binary expectedResultValue) |
| Tests for a single assertion for a call returning a binary value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, hash expectedResultValue) |
| Tests for a single assertion for a call returning a hash value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, list expectedResultValue) |
| Tests for a single assertion for a call returning a list value and returns the value generated. More... | |
| auto | testAssertion (string name, code condition, *softlist< auto > args, QUnit::AbstractTestResult expectedResult=new QUnit::TestResultSuccess()) |
| Tests for a single assertion and returns the value generated. More... | |
| auto | testAssertionValue (*string name, auto actual, auto expected) |
| Tests a value for equality to an expected value. More... | |
| testNullAssertion (string name, code condition, *softlist< auto > args) | |
| Tests for a single assertion for a call returning no value (for example, to ensure that the call does not throw an exception) More... | |
| testSkip (string reason) | |
| Skips a given test, eg. because it may be missing some dependencies. More... | |
Public Member Functions inherited from QUnit::TestReporter | |
| constructor (string name, string version, *reference< list< string >> p_argv, hash opts=Opts) | |
| creates the object from the arguments More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from QUnit::Test | |
| static string | getAssertionName (*string name) |
| returns the assertion name for display purposes | |
Public Attributes inherited from QUnit::TestReporter | |
| const | Opts |
| default options for Qore::GetOpt::constructor() | |
A class representing a test with injected dependencies.