git @ Cat's Eye Technologies Falderal / 272a966
Directly specifying the functionality in a "Tests for" is no more. Chris Pressey 6 years ago
1 changed file(s) with 0 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
219219 -> Tests for 'Reversing a string'
221 Alternatively, the following direct way of associating tests with an
222 implementation of a functionality, may be used. However, this direct way
223 of specifying a functionality is discouraged when there may be conceivably
224 be multiple implementation of the functionality.
226 -> Tests for _functionality-type_ _functionality-specifier_
228 _functionality-type_ and _functionality-specifier_ have the same meaning
229 as given in the description of the Functionality-definition pragma.
231 For example:
233 -> Tests for Haskell function Data.Backwards:reverseString
235221 Test Body, Test Input and Expected Text
236222 ---------------------------------------
322308 The format of pragmas was chosen such that they could be read literately,
323309 and as such, a formatting tool could format them in the output document
324310 with little if any change.
326 Here is why directly specifying the functionality implementation in a
327 Tests-for pragma is discouraged. Saying `-> Tests for shell command
328 "flang %(test-body-text)"` ties a set of tests to a particular executable,
329 that is to say a particular *implementation* of a language, which is being
330 tested, but a large part of the point of Falderal is to let you write
331 tests for a *language*, and that language might have *many* implementations.
332 Decoupling them allows you to change what actual functions or programs
333 are being tested, and basically allow you to have multiple implementations
334 of a language and use the same tests for all of them.