Permalink
Browse files

Refining the exception operator

  • Loading branch information...
1 parent 85687e8 commit e3db10c1f6885d65d370de2ca0684968d53e7fe2 @Gianfrancoalongi committed Nov 18, 2012
Showing with 22 additions and 8 deletions.
  1. +22 −8 requirement_specification.org
@@ -133,20 +133,34 @@ a vector. This shall also be printed for quick readability.
#+END_EXAMPLE
* SHOULD
-** [t] Assertion operator to expect events with certain ⎕EN
+** [t] Assertion operator to expect events with ⎕EN and possibly ⎕DM
It shall be possible to assert that the RHS execution will
-result in an exception event with a given ⎕EN and possibly
-a defined ⎕DM.
+result in an exception with a given ⎕EN and a possibly given ⎕DM.
+
+The operator shall accept scalars and 2 element arrays as left argument.
+If a scalar is given as left argument, it signifies the expected ⎕EN.
#+BEGIN_EXAMPLE
-exception_TEST ← { LHS UT.exception RHS }
+ SCALAR UT.exception RHS
#+END_EXAMPLE
-The behaviour should behave similarly as the return value
-assertion operator. If the RHS raises an exception, and the
-⎕EN matches the LHS - it shall return 1. If the ⎕EN does not match
-the LHS it shall return 0. If no exception is raised, return 0.
+If the RHS raises an exception with ⎕EN equal to SCALAR, this returns 1,
+in all other cases - it will return 0.
+
+In the 2-element array form , the first element is the scalar signifying
+the expected ⎕EN and the second element is the expected ⎕DM.
+
+#+BEGIN_EXAMPLE
+ (SCALAR TEXT) UT.exception RHS
+#+END_EXAMPLE
+
+If the RHS raises an exception with ⎕EN equal to SCALAR and ⎕DM
+equal to TEXT this will return 1, in all other cases - it will return 0.
+
+#+BEGIN_EXAMPLE
+exception_TEST ← { LHS UT.exception RHS }
+#+END_EXAMPLE
** [t] Coverage report from Unit Test execution

0 comments on commit e3db10c

Please sign in to comment.