Return array as symbol
Sometimes it might be desirable to be able to store an array returned from a test in a symbol and to compare entries of that array with values in later tests.To use this feature, implement a method in your fixture that returns a String array. For an example, see the asArray method of the CompareValuesFixture class. To use an array entry in comparison with an expected output, add a $ to the end of the columnname (see Symbol and array comparison).
The array is 1 based instead of 0 based.
Demonstration
First store value1 and value2 as array in symbol myArray.
CompareValues | ||
value1 | value2 | =asArray? |
1 | 2 | myArray = [1, 2] |
Compare first and second entry from array with new value1.
CompareValues | |
value1 | value1?$ |
1 | 1 (myArray.1) |
2 | 2 (myArray.2) |