Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

UT.dyalog - added full path to EN - so that file tests can work with …

…exception expectation

UTFile.dyalog - added a multi line exception expectation test
UT_tests.dyalog - moved the tests around and added banners
  • Loading branch information...
commit dc7af627d727a2bbfdf7d0386e25b4f334beaba1 1 parent 85dbb34
@Gianfrancoalongi authored
Showing with 17 additions and 8 deletions.
  1. +8 −7 UT.dyalog
  2. +5 −0 UTFile.dyalog
  3. +4 −1 UT_tests.dyalog
View
15 UT.dyalog
@@ -12,11 +12,12 @@ EN ← ⍬
Z run Function;Res;Tmp
Tmp 1 ⎕RSI
Tmp ( ⎕THIS) ⎕NS (( Tmp),'.',Function)
- :Trap 0
+ :Trap 0
Res execute_function Function
- :If EN
- Function display_expected_got EN
+ :If #.UT.EN
+ Function display_expected_got #.UT.EN
Z 0
+ #.UT.EN
:Else
Z Res
:If 1 = ⍴⍴ Res
@@ -25,13 +26,13 @@ EN ← ⍬
:EndIf
:EndIf
:Else
- :If EN
+ :If #.UT.EN
Z 1
- :If EN ⎕EN
- Function display_expected_got EN ⎕EN
+ :If #.UT.EN ⎕EN
+ Function display_expected_got #.UT.EN ⎕EN
Z 0
:EndIf
- EN
+ #.UT.EN
:Else
display_exception Function
Z ⎕EN
View
5 UTFile.dyalog
@@ -8,5 +8,10 @@ fromfile_single_line_array_TEST ← { (1,⍬) (1 2) (1 2 3) #.UT.eq ⍳¨⍳3 }
fromfile_single_line_failing_array_TEST { 1 (1 2) (1 2 3) #.UT.eq ¨3 }
+ fromfile_multi_line_exception_2_TEST;A
+ A 3
+ #.UT.EN 2
+ A
+
:EndNameSpace
View
5 UT_tests.dyalog
@@ -58,6 +58,7 @@ no_exception_single_line_exception_TEST ← { #.UT.EN ← 2 ⋄ 1 + 2 }
Z Tests
Z
+ '================== Starting Unit Test Execution ================='
Z , 1 #.UT.run 'single_line_TEST'
Z , 0 #.UT.run 'single_line_failing_TEST'
Z , 1 #.UT.run 'single_line_array_TEST'
@@ -66,7 +67,6 @@ no_exception_single_line_exception_TEST ← { #.UT.EN ← 2 ⋄ 1 + 2 }
Z , 0 #.UT.run 'multi_line_failing_scalar_TEST'
Z , 1 #.UT.run 'multi_line_array_TEST'
Z , 0 #.UT.run 'multi_line_array_failing_TEST'
- Z , (2 0 2) #.UT.run_file '/home/gianfranco/APL/UnitTestFrameWork/UTFile.dyalog'
Z , 2 #.UT.run 'single_line_syntax_error_TEST'
Z , 3 #.UT.run 'multi_line_index_error_TEST'
Z , 1 #.UT.run 'single_line_exception_2_TEST'
@@ -74,6 +74,9 @@ no_exception_single_line_exception_TEST ← { #.UT.EN ← 2 ⋄ 1 + 2 }
Z , 1 #.UT.run 'multi_line_exception_3_TEST'
Z , 0 #.UT.run 'multi_line_exception_3_failing_TEST'
Z , 0 #.UT.run 'no_exception_single_line_exception_TEST'
+ '====== Execution from file'
+ Z , (3 0 2) #.UT.run_file '/home/gianfranco/APL/UnitTestFrameWork/UTFile.dyalog'
+ '================= Finished Unit Test Execution =================='
:EndNameSpace
Please sign in to comment.
Something went wrong with that request. Please try again.