| import |
| fitnesse.slim.test |
Symbols values and assignments can be used in Table Table fixtures
Given some symbol values
| script | ||
| $A= | echo int | 99 |
| $B= | echo int | 5 |
| $C= | echo int | 14 |
Then in a Table Table the symbols can be used and values can be assigned to existing or new symbols.
The fixture requires no code to handle symbols!
| table: Table Table Inc First Col | |
| $A | $resultA= |
| $B | $resultB= |
| $C | $C= |
| script | |||
| check | echo int | $resultA | 100 |
| check | echo int | $resultB | 6 |
| check | echo int | $C | 15 |
But you can't use assignments done in one row in subsequent rows.
Included page: SymbolAssignmentAndReferenceOfTheSameInOneTable (edit)
| import |
| fitnesse.slim.test |
| script | ||
| $X= | echo int | 199 |
| $Y= | echo int | 44 |
| table: Table Table Inc First Col | ||
| 12 | $SymbolsInTableTable= | # Assign to a new symbol |
| $X | $Y= | # Assign to an existing symbol |
| $Y | $Z= | # Assign a freshly assigned value |
Z is 45 and not 201 :(
| script | |||
| check | echo int | $Z | 45 |
| check | echo int | $SymbolsInTableTable | 13 |
This requires symbol aware code in the fixture.
See TestTableTableImplementingStatementExecutorConsumer how to do this.