I am fairly new to Fitnesse. I am using the Subset Query Table. It works fine except when I have to compare a float value. Is there a any way I can compare the values to certain level of accuracy ?
For instance the test should pass when I compare 4.12 to 4.1234. But right now, it looks like it is making a string comparison and it fails. Is there anyway I can override the validation part ?
To achieve approx comparison of Double and Float values, I have override the fixture class as the following:
The two TypeAdapter class use both relative value epsilon and absolute value precision for comparison. The precision is detected from the expected input, so that 23.099 has precision 0.001. They also expect special values, such as "nan" for NaN, and "inf" for +/-Infinitive. Here is one example:
You can use the tilde character to mean 'approximately equal to', e.g. ~=4.12
See http://fitnesse.org/FitNesse.UserGuide.SliM.ValueComparisons for more details.