Add coverage, get to near 100
[sheep] / src / test / failures.lisp
index 76f815d38b108c00ff0260ec90fd57d992c091f6..87cfa5896be68f623c8e218f57b31fb5b08d655b 100644 (file)
@@ -339,6 +339,43 @@ DESCRIPTION:
 "
  "Expected ARGUMENTS AND VALUES: instead of: ARGUUMENTS AND VALUES:")
 
+(deffailure-func-test
+ "Args-and-values - non empty next line"
+ "UNUSED => RESULT
+
+ARGUMENTS AND VALUES:
+
+  RESULT: a pathname
+  RESULT2: a thing
+
+DESCRIPTION:
+
+"
+ "No arguments left, but next line isn't empty:   RESULT2: a thing")
+
+(deffailure-func-test
+ "Args-and-values - out of order arguments"
+ "UNUSED => RESULT1, RESULT2
+
+ARGUMENTS AND VALUES:
+
+  RESULT2: a thing
+  RESULT1: a thing
+
+DESCRIPTION:
+
+"
+ "Expected a description for RESULT1 but got one for RESULT2")
+
+(deffailure-func-test
+ "Args-and-values - ended before all arguments"
+ "UNUSED => RESULT1, RESULT2
+
+ARGUMENTS AND VALUES:
+
+  RESULT1: a thing"
+ "Expected line after:   RESULT1: a thing")
+
 (deffailure-func-test
  "Header - first line doesn't start with func-name (naturally all in upper case)"
  "UNUUSED => RESULT
@@ -378,6 +415,56 @@ DESCRIPTION:
 "
  "Result in UNUSED should be all upper case: REsULT")
 
+(deffailure-func-test
+ "Description - can't end line with space"
+ "UNUSED => RESULT
+
+ARGUMENTS AND VALUES:
+
+  RESULT: a pathname
+
+DESCRIPTION:
+
+  This is a test 
+"
+ "Can't end line with a space:   This is a test ")
+
+(deffailure-func-test
+ "Symbols - keyword symbols must be all in lower case"
+ "UNUSED => RESULT
+
+  RESULT: (:ASDF)
+
+DESCRIPTION:
+
+  This is a test 
+"
+ "Keyword symbols must all be lower case: :ASDF")
+
+(deffailure-func-test
+ "Symbols - type symbols must be all in lower case"
+ "UNUSED => RESULT
+
+  RESULT: (asdf)
+
+DESCRIPTION:
+
+  This is a test 
+"
+ "Type symbols must all be upper case: asdf")
+
+(deffailure-func-test
+ "Symbols - list types can't have | in them"
+ "UNUSED => RESULT
+
+  RESULT: (ASDF | FDSA)
+
+DESCRIPTION:
+
+  This is a test 
+"
+ "List types can't have | in them: (ASDF | FDSA)")
+
 (deffailure-var-test
  "Blank line - after value type"
  "*UNUSED*
@@ -672,3 +759,103 @@ VALUE TYPE:
 
   a generalized boolean"
  "Got unexpected line, requires blank lines or start with two spaces: NIL")
+
+(deffailure-var-test
+ "General - Can't end line with a space"
+ "*UNUSED*
+
+VALUE TYPE:
+
+  a generalized boolean
+
+INITIAL VALUE:
+
+  NIL
+
+DESCRIPTION:
+
+  This description line ends with a space "
+ "Can't end line with a space:   This description line ends with a space ")
+
+(deffailure-var-test
+ "General - Longer than 120 characters"
+ (format nil "~A~A"
+  "*UNUSED*
+
+VALUE TYPE:
+
+  a generalized boolean
+
+INITIAL VALUE:
+
+  NIL
+
+DESCRIPTION:
+
+  This description line ends with a space is very very long, so very long, really really long"
+  "it just keeps going and going and going and going and going and going")
+ (format nil "Longer than 120 chars:   ~A~A"
+  "This description line ends with a space is very very long, so very long, really really long"
+  "it just keeps going and going and going and going and going and going"))
+
+(deffailure-pkg-test
+ "Line too long"
+ "Unused package with a first line that is extremely long, and how could it be so
+long and it keeps going and going and going and going and going and going"
+ "First package paragraph is longer than 120 characters")
+
+(deffailure-pkg-test
+ "Line too long 2"
+ (format nil "~A~A"
+  "Unused package with a first line that is extremely long, and how could it be so"
+  "long and it keeps going and going and going and going and going and going")
+ (format nil "~A~A~A"
+  "Package description longer than 120 characters: "
+  "Unused package with a first line that is extremely long, and how could it be so"
+  "long and it keeps going and going and going and going and going and going"))
+
+(deffailure-pkg-test
+ "Two empty lines"
+ "Basic description
+
+
+More information"
+ "Package description has two empty lines in it")
+
+(deffailure-pkg-test
+ "Started with space"
+ " Basic Description"
+ "Package description line started with space:  Basic Description")
+
+(deffailure-pkg-test
+ "Ended with space"
+ "Basic Description "
+ "Package description line ended with space: Basic Description ")
+
+(deffailure-struc-test
+ "Two empty lines"
+ "Basic description
+
+
+More information"
+ "Structure description has two empty lines in it")
+
+(deffailure-struc-test
+ "Line too long"
+ (format nil "~A~A"
+  "Unused package with a first line that is extremely long, and how could it be so"
+  "long and it keeps going and going and going and going and going and going")
+ (format nil "~A~A~A"
+  "Structure description longer than 120 characters: "
+  "Unused package with a first line that is extremely long, and how could it be so"
+  "long and it keeps going and going and going and going and going and going"))
+
+(deffailure-struc-test
+ "Started with space"
+ " Basic Description"
+ "Structure description line started with space:  Basic Description")
+
+(deffailure-struc-test
+ "Ended with space"
+ "Basic Description "
+ "Structure description line ended with space: Basic Description ")