Each tabtest is represented as a table, where:
Generally, literals for tabtests are the same that are used in the Inspector. But also there are few special literals for tabtests only.
Literal | Meaning | Description |
---|---|---|
23 , -76 |
Integers | |
0.035 , -29.7054 |
Floats | |
NaN |
NaN | It's "valid" Number, that can be produced sometimes. For example, by diving zero by zero. |
Inf , -Inf |
Infinities | Note, that these Numbers are bigger or smaller even than maximum or minimum possible values of type uint32. |
0.123~ , -384.7583~ |
Approximate floats | Special literals for tabtests and for expected outputs only. Since we're dealing with floats in the XOD some math can give us float numbers like 0.49999999999 or sometimes the same calculation may give us 0.50000000001 , but both of them expected as 0.5 . Alternatively, another one example: -384.75833333 can be expected as -384.7583 . So when you put a tilde at the end of the number it tells to test runner with desired precision we want to test: 0.5~ or -384.7583~ . All the next numbers are rounded. |
Literal | Meaning | Description |
---|---|---|
"Hello, World!" |
String | Note that string should be enquoted |
"He said: \"Hello\"" |
String with quotes | To use quotes inside string escape them with backslashes |
Literal | Meaning | Description |
---|---|---|
true |
True | |
false |
False |
Literal | Meaning | Description |
---|---|---|
pulse |
Send or Expect Pulse | If pulse is defined for input it means that we send pulse. For output — expecting pulse in this transaction. |
no-pulse |
Do not send or expect no pulse | If no-pulse is defined for input it means that we do not send pulse. For output — expecting there will be no pulse in this transaction. |
Name the column: __time(ms)
Values can be non-negative integers.
If you test something with defer
nodes inside, do not forget to increment the time on each test case or defer
node on the execution of the next test case will think that is the same transaction and won’t fire the output pulse or output-value.