Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving around functions for proximity in order to facilitate

refactoring
  • Loading branch information...
commit 66ad54a7dc4ff47099cab43a90f11d4cac0db2b5 1 parent cb7e104
@Gianfrancoalongi authored
Showing with 61 additions and 61 deletions.
  1. +61 −61 UT.dyalog
View
122 UT.dyalog
@@ -2,13 +2,6 @@
EN
- Z LHS eq RHS
- Z 1
- :If LHS RHS
- Z LHS RHS
- :EndIf
-
-
Z run Function;Res;Tmp
Tmp 1 ⎕RSI
Tmp ( ⎕THIS) ⎕NS (( Tmp),'.',Function)
@@ -41,6 +34,57 @@ EN ← ⍬
⎕EX Function
+ Z run_file Path;TmpSpace;Fns;Res;Passed;Failed;Exception
+ 'TmpSpace' ⎕NS ''
+ 'TmpSpace' ⎕NS '#.DISPLAY'
+ {'TmpSpace' ⎕NS } ¨ #.UT.⎕NL 3
+ {'TmpSpace' ⎕NS } ¨ #.UT.⎕NL 2
+ ⎕CS 'TmpSpace'
+ ⎕SE.SALT.Load Path
+ ⎕CS get_namespace
+ { ( ⎕THIS) ⎕NS '#.UT.', } ¨ #.UT.⎕NL 3
+ { ( ⎕THIS) ⎕NS '#.UT.', } ¨ #.UT.⎕NL 2
+ Fns ⎕THIS.⎕NL 3
+ Fns ( is_test ¨ Fns) / Fns
+ Res run ¨ Fns
+ (Passed Exception Failed) (+/1=Res) (+/0Res1Res) (+/0=Res)
+ print_file_result Passed Exception Failed
+ ⎕CS ##
+ ⎕CS ##
+ ⎕EX 'TmpSpace'
+ Z Passed Exception Failed
+
+
+ Z run_group Group;Res
+ ⎕CS 1 ⎕RSI
+ Res #.UT.run ¨ (⍎ Group)
+ ⎕CS #.UT
+ Res (+/1=Res) (+/0Res1Res) (+/0=Res)
+ Group print_group_result Res
+ Z Res
+
+
+ Z Group run_group_file Path;Res
+ 'TmpSpace' ⎕NS ''
+ ⎕CS 'TmpSpace'
+ ⎕SE.SALT.Load Path
+ ⎕CS ⎕NL 9
+ Res #.UT.run ¨ ⍎ Group
+ ⎕CS ##
+ ⎕EX 'TmpSpace'
+ ⎕CS #.UT
+ Res (+/1=Res) (+/0Res1Res) (+/0=Res)
+ Group print_file_group_result Res
+ Z Res
+
+
+ Z LHS eq RHS
+ Z 1
+ :If LHS RHS
+ Z LHS RHS
+ :EndIf
+
+
Z execute_function Name;R;C
(R C) ⎕CR Name
:If R > 1
@@ -50,20 +94,6 @@ EN ← ⍬
:EndIf
- Name display_expected_got Res
- 'FAILED:',function_header Name
- 'Expected'
- show_term Res[1]
- 'Got'
- show_term Res[2]
-
-
- display_exception Name
- 'EXCEPTION:',function_header Name
- ' EN:',⎕EN
- ⎕DM
-
-
Z function_header Name;Matrix;R;C
Matrix ⎕CR Name
@@ -84,27 +114,6 @@ EN ← ⍬
:EndIf
- Z run_file Path;TmpSpace;Fns;Res;Passed;Failed;Exception
- 'TmpSpace' ⎕NS ''
- 'TmpSpace' ⎕NS '#.DISPLAY'
- {'TmpSpace' ⎕NS } ¨ #.UT.⎕NL 3
- {'TmpSpace' ⎕NS } ¨ #.UT.⎕NL 2
- ⎕CS 'TmpSpace'
- ⎕SE.SALT.Load Path
- ⎕CS get_namespace
- { ( ⎕THIS) ⎕NS '#.UT.', } ¨ #.UT.⎕NL 3
- { ( ⎕THIS) ⎕NS '#.UT.', } ¨ #.UT.⎕NL 2
- Fns ⎕THIS.⎕NL 3
- Fns ( is_test ¨ Fns) / Fns
- Res run ¨ Fns
- (Passed Exception Failed) (+/1=Res) (+/0Res1Res) (+/0=Res)
- print_file_result Passed Exception Failed
- ⎕CS ##
- ⎕CS ##
- ⎕EX 'TmpSpace'
- Z Passed Exception Failed
-
-
Z get_namespace
Z ⎕NL 9
@@ -118,27 +127,18 @@ EN ← ⍬
Z '_TEST' ¯5 Tmp
- Z run_group Group;Res
- ⎕CS 1 ⎕RSI
- Res #.UT.run ¨ (⍎ Group)
- ⎕CS #.UT
- Res (+/1=Res) (+/0Res1Res) (+/0=Res)
- Group print_group_result Res
- Z Res
+ Name display_expected_got Res
+ 'FAILED:',function_header Name
+ 'Expected'
+ show_term Res[1]
+ 'Got'
+ show_term Res[2]
- Z Group run_group_file Path;Res
- 'TmpSpace' ⎕NS ''
- ⎕CS 'TmpSpace'
- ⎕SE.SALT.Load Path
- ⎕CS ⎕NL 9
- Res #.UT.run ¨ ⍎ Group
- ⎕CS ##
- ⎕EX 'TmpSpace'
- ⎕CS #.UT
- Res (+/1=Res) (+/0Res1Res) (+/0=Res)
- Group print_file_group_result Res
- Z Res
+ display_exception Name
+ 'EXCEPTION:',function_header Name
+ ' EN:',⎕EN
+ ⎕DM
print_file_result Result
Please sign in to comment.
Something went wrong with that request. Please try again.