1 (in-package #:docgen-test)
4 ((long-line (format nil "~A~A"
5 "This second section uses PATH and X as something we should talk about, "
6 "but doesn't use all the arguments (let's include PATH here for fun)")))
9 (format nil "UNUSED => RESULT
19 (format nil "Longer than 120 chars: ~A" long-line)))
22 "Blank line - after args and vals"
31 "Expected blank line after: ARGUMENTS AND VALUES:")
34 "Blank line - after description"
45 "Expected blank line after: DESCRIPTION:")
48 "Blank line - after examples"
63 "Expected blank line after: EXAMPLES:")
66 "Blank line - after header"
70 "Expected blank line after: UNUSED => RESULT")
73 "Two spaces - beginning of types"
79 "Type line did not match \" TYPE: type-definition\": RESULT1: NOT-HERE")
82 "Two spaces - beginning of args and values"
89 "Argument line did not match \" TYPE: desc\": RESULT: fail here")
92 "Two spaces - in description"
101 This is a description
105 "Got unexpected line, requires blank lines or start with two spaces: \" things\"")
107 (deffailure-func-test
108 "Two spaces - in examples"
111 ARGUMENTS AND VALUES:
117 This is a description
122 (example2) => (yoyo)"
123 "Example line does not match \" example => result\": (example2) => (yoyo)")
125 (deffailure-func-test
126 "Two spaces - in examples"
129 ARGUMENTS AND VALUES:
135 This is a description
140 (example2) => (yoyo)"
141 "Example line does not match \" example => result\": (example2) => (yoyo)")
143 (deffailure-func-test
144 "Bad type - lowercase symbol"
150 "Result in UNUSED should be all upper case: REsULT")
152 (deffailure-func-test
153 "Bad type - or type with list"
156 RESULT: RESULT1 | (RESULT2 :success)
159 "Or types can't have lists in them: RESULT1 | (RESULT2 :success)")
161 (deffailure-func-test
162 "Bad type - or type with no space before pipe"
165 RESULT: RESULT1| RESULT2
168 "All or pipes must be prefaced by spaces: RESULT1| RESULT2")
170 (deffailure-func-test
171 "Bad type - or type with no space after pipe"
174 RESULT: RESULT1 |RESULT2
177 "All or pipes must be concluded by spaces: RESULT1 |RESULT2")
179 (deffailure-func-test
180 "Bad type - list separated by multiple spaces"
183 RESULT: (RESULT1 :success)
186 "Lists can be seperated by only one space: (RESULT1 :success)")
188 (deffailure-func-test
189 "Bad type - list parens in them"
192 RESULT: (RESULT1 (:success))
195 "List types can't have sublists: (RESULT1 (:success))")
197 (deffailure-func-test
198 "Bad type - type line doesn't have colon"
204 "Type line did not match \" TYPE: type-definition\": RESULT - RESULT1")
206 (deffailure-func-test
207 "Bad type - malformed type line with colon"
210 RESULT: RESULT1 RESULT2
213 "Symbols had spaces in it: RESULT1 RESULT2")
215 (deffailure-func-test
216 "types in type section that isn't in document"
223 "Ran out of types to talk about, but got a non empty line: RESULT2: RESULT3")
225 (deffailure-func-test
226 "Description - ends with empty line when last thing"
229 ARGUMENTS AND VALUES:
238 "Can't end with empty line")
240 (deffailure-func-test
241 "Description - malformed line"
244 ARGUMENTS AND VALUES:
251 "Got unexpected line, requires blank lines or start with two spaces: \" A mistake\"")
253 (deffailure-func-test
254 "Description - section doesn't start with description"
257 ARGUMENTS AND VALUES:
264 "Expected DESCRIPTION: instead of: DESCRIPTAION:")
266 (deffailure-func-test
267 "Examples - doesn't have arrow"
270 ARGUMENTS AND VALUES:
276 This is a mock description.
282 "Example line does not match \" example => result\": (unused) - :success")
284 (deffailure-func-test
285 "Examples - doesn't start with EXAMPLES"
288 ARGUMENTS AND VALUES:
294 This is a mock description.
298 (unused) => :success"
299 "Got unexpected line, requires blank lines or start with two spaces: \"EXAAMPLES:\"")
301 (deffailure-func-test
302 "Args-and-values - leftover unexplained args"
305 RESULT: RESULT1 | RESULT2
307 ARGUMENTS AND VALUES:
311 "Unexplained arguments left: (RESULT2)")
313 (deffailure-func-test
314 "Args-and-values - doesn't match TYPE: desc"
317 ARGUMENTS AND VALUES:
324 "Argument line did not match \" TYPE: desc\": RESULT - a pathname")
326 (deffailure-func-test
327 "Args-and-values - section doesn't start with ARGUMENTS AND VALUES:"
332 ARGUUMENTS AND VALUES:
339 "Expected ARGUMENTS AND VALUES: instead of: ARGUUMENTS AND VALUES:")
341 (deffailure-func-test
342 "Header - first line doesn't start with func-name (naturally all in upper case)"
345 ARGUMENTS AND VALUES:
352 "First line of UNUSED did not match: UNUSED {ARGS}* => {RESULT}*, UNUUSED => RESULT")
354 (deffailure-func-test
355 "Header - arguments weren't in upper cse"
358 ARGUMENTS AND VALUES:
365 "Argument in UNUSED should be all upper case: \"x\"")
367 (deffailure-func-test
368 "Header - results weren't in upper case"
371 ARGUMENTS AND VALUES:
378 "Result in UNUSED should be all upper case: REsULT")
381 "Blank line - after value type"
394 "Expected blank line after: VALUE TYPE:")
397 "Blank line - after description"
412 "Expected blank line after: DESCRIPTION:")
415 "Blank line - after examples"
434 "Expected blank line after: EXAMPLES:")
437 "Blank line - after header"
441 "Expected blank line after: *UNUSED*")
444 "Two spaces - beginning of value type"
449 a generalized boolean
451 "Got unexpected line, requires blank lines or start with two spaces: \" a generalized boolean\"")
454 "Two spaces - beginning of initial value"
459 a generalized boolean
465 "Got unexpected line, requires blank lines or start with two spaces: \" RESULT: fail here\"")
468 "Two spaces - in description"
473 a generalized boolean
481 This is a description
485 "Got unexpected line, requires blank lines or start with two spaces: \" things\"")
488 "Two spaces - in examples"
493 a generalized boolean
501 This is a description
506 (example2) => (yoyo)"
507 "Example line does not match \" example => result\": (example2) => (yoyo)")
510 "Two spaces - in examples"
515 a generalized boolean
523 This is a description
528 (example2) => (yoyo)"
529 "Example line does not match \" example => result\": (example2) => (yoyo)")
532 "Description - ends with empty line when last thing"
537 a generalized boolean
548 "Can't end with empty line")
551 "Description - malformed line"
556 a generalized boolean
565 "Got unexpected line, requires blank lines or start with two spaces: \" A mistake\"")
568 "Description - section doesn't start with description"
573 a generalized boolean
582 "Got unexpected line, requires blank lines or start with two spaces: \"DESCRIPTAION:\"")
585 "Examples - doesn't have arrow"
590 a generalized boolean
598 This is a mock description.
604 "Example line does not match \" example => result\": *unused* - :success")
607 "Examples - doesn't start with EXAMPLES"
612 a generalized boolean
620 This is a mock description.
624 *unused* => :success"
625 "Got unexpected line, requires blank lines or start with two spaces: \"EXAAMPLES:\"")
628 "Header - first line doesn't start with var-name (naturally all in upper case)"
638 "First line of *UNUSED* did not match: *UNUSED*, *UNUUSED*")
641 "General - No value type"
651 "Expected VALUE TYPE: instead of: INITIAL VALUE:")
654 "General - No initial value"
659 a generalized boolean
664 "Got unexpected line, requires blank lines or start with two spaces: \"DESCRIPTION:\"")
667 "General - Ends early"
672 a generalized boolean"
673 "Got unexpected line, requires blank lines or start with two spaces: NIL")