Changes between Version 8 and Version 9 of BluePrint/XsltTesting
- Timestamp:
- 06/06/14 11:34:20 (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BluePrint/XsltTesting
v8 v9 21 21 The transformed file will need to be compared against the golden file. Options for performing the comparison: 22 22 23 * For XML output, read both the transformed file and the golden file into etrees, and compare those.23 * For XML output, transform the input file, which will yield an etree. Read the golden file into an etree as well. Then compare the etrees. 24 24 25 25 * For S3XML output, read both using S3XML utilities and compare the S3XML trees. 26 26 27 * For other formats, compare the files as strings.27 * For other formats, transform the input, then convert it to a string. Read in the golden file and do a textual comparison. 28 28 29 29 String comparison is fragile, as alterations in whitespace or change in ordering of elements (where that change is not significant to the meaning) will break the test. However, this is simple, and may be appropriate for getting started, even for formats that produce XML or S3XML. 30 30 31 This can be made less fragile by ignoring whitespace and similar differences where they are not significant -- the user can be allowed to specify what can be ignored. 32 31 33 * Allow the user to provide a comparison function. 32 34 35 This goes against the purpose of making testing easy, so should be avoided. If this becomes necessary, the user can be allowed to specify the function in the options. These comparison functions could be added to the test helper, or placed in other files in the same directory. 33 36 This goes against the purpose of making testing easy, so should be avoided.