The Unittest library is used to compile unit test code for the Cangjie project. It provides basic functions including code writing, running, and debugging, and some advanced functions for experienced users. The Cangjie unit test supports the CJC compiler (single-package compilation mode) and CJPM package manager (multi-package mode).
Specifies an object for storing the unittest configuration data generated by the @Configure macro. Configuration is a class similar to HashMap, but its key is not of a key or value type but of a String type and its value is of any given type.
Generates random data of type T. T must implement the Arbitrary<T> interface. The returned value of this function is a parameter source for parameterized tests.
Reads the data value of type T from a JSON file. T must be serializable. The returned value of this function is a parameter source of the parameterized test.
Reads the data value of type T from the TSV file. T must be serializable. The returned value of this function is a parameter source of the parameterized test.
Specifies an interface used to handle performance testing. It requires executing specific code before each invocation of the performance test. When the input for the performance test changes, the input data must be regenerated from scratch each time.
Specifies an interface for collecting and analyzing various data during performance testing. The specific instance used by the performance test framework is specified by the measurement parameter of the @Configure macro.
Specifies the simplest input provider that merely copies data for each benchmark call. It is applicable to the scenario where the benchmark test does not change the input. This is the default provider used within the framework.