Permalink
Browse files

More refactoring with extract method

  • Loading branch information...
1 parent 95034b4 commit af26cd9acf16a382e7da25e23a317a46342d5bb9 @Gianfrancoalongi committed Dec 8, 2012
Showing with 26 additions and 13 deletions.
  1. +26 −13 UT.dyalog
View
@@ -21,26 +21,39 @@ EN ← ⍬
Z 0
+ Z exception_number_does_not_match_expected
+ Z #.UT.EN ⎕EN
+
+
+ Z failure_exception_failed Function
+ Function display_expected_got #.UT.EN ⎕EN
+ Z 0
+
+
+ Z Function check_success_or_failure Res
+ :If expecting_an_exception
+ Z failure_due_to_no_exception Function
+ :Else
+ :If test_failure Res
+ Z Function failure_test_failed Res
+ :Else
+ Z Res
+ :EndIf
+ :EndIf
+
+
Z run Function;Res;Tmp
Tmp 1 ⎕RSI
Tmp ( ⎕THIS) ⎕NS (( Tmp),'.',Function)
:Trap 0
Res execute_function Function
+ Z Function check_success_or_failure Res
+ :Else
:If expecting_an_exception
- Z failure_due_to_no_exception Function
- :Else
- :If test_failure Res
- Z Function failure_test_failed Res
+ :If exception_number_does_not_match_expected
+ Z failure_exception_failed Function
:Else
- Z Res
- :EndIf
- :EndIf
- :Else
- :If #.UT.EN
- Z 1
- :If #.UT.EN ⎕EN
- Function display_expected_got #.UT.EN ⎕EN
- Z 0
+ Z 1
:EndIf
#.UT.EN
:Else

0 comments on commit af26cd9

Please sign in to comment.