]> gitweb.michael.orlitzky.com - octave.d.git/commitdiff
unit_test/*.m: delete trailing whitespace
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 7 Apr 2026 14:38:10 +0000 (10:38 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 7 Apr 2026 14:39:03 +0000 (10:39 -0400)
unit_test/erreval.m
unit_test/unit_init.m
unit_test/unit_results.m
unit_test/unit_test.m

index 995d854acbffa3a8829bf740c5a71e4b3a8fa5e8..ab7acbccd80089124c0a1203abde014b6e428f3e 100644 (file)
@@ -2,16 +2,16 @@ function rv = erreval(error_prefix, try_str, catch_str)
   ## erreval() extends the built-in function eval().  Return 0 if
   ## try_str does not raise the error of type error_prefix, return 1
   ## otherwise.
-  
+
   global unittest_results;
   for k = 1:length(unittest_results.eval_globals)
     eval(unittest_results.eval_globals{k});
   end
-  
+
   rv = 0;
   try
     eval(try_str);
   catch
     rv = errcheck(error_prefix);
-  end  
+  end
 endfunction
index b692a80b8827096576728ee3de0be5773ab7c9a3..f7fa7ef35aafdb798a8fc579cee78be60da44d3f 100644 (file)
@@ -5,9 +5,9 @@ function unit_init(verbosity, global_vars)
   ## names of the global variables used in the tests.
   ##
   ## e.g. unit_init(1, {"g", "a", "x"})
-  
+
   global unittest_results;
-  
+
   unittest_results.verbose = 0;
   unittest_results.eval_globals = {};
   if (nargin > 0)
@@ -16,7 +16,7 @@ function unit_init(verbosity, global_vars)
     else
       unittest_results.verbose = verbosity;
     endif
-    
+
     if (nargin == 2 && iscell(global_vars))
       for i = 1:length(global_vars)
         unittest_results.eval_globals{i} = strcat("global ", global_vars{i}, ";");
@@ -24,18 +24,18 @@ function unit_init(verbosity, global_vars)
     else
       error("global_vars must be a cell array");
     endif
-    
+
     if (nargin > 2)
       usage("expecting 2 arguments only");
     end
   endif
-  
+
   unittest_results.total = 0; # number of testcases attempted
   unittest_results.pass = 0;  # number of expected passed
   unittest_results.fail = 0;  # number of unexpected failures
   unittest_results.upass = 0; # number of unexpected passes
   unittest_results.xfail = 0; # number of expected failures
   unittest_results.unresolved = 0; # number of unresolved testcases
-  
+
   default_eval_print_flag = 0;
 endfunction
index f6485ba1276524fa0055c048bf3a959e7c151e27..d2683c3e72e1aa533845a5cc7fc98a3be58ced6f 100644 (file)
@@ -1,8 +1,8 @@
 function unit_results()
   ## Print the results from previous unittest calls in pretty format.
-  
+
   global unittest_results;
-  
+
   printf("\n");
   printf("# of testcases attempted   %d\n", unittest_results.total);
   printf("# of expected passes       %d\n", unittest_results.pass);
@@ -11,7 +11,7 @@ function unit_results()
   printf("# of unexpected failures   %d\n", unittest_results.fail);
   printf("# of unresolved testcases  %d\n", unittest_results.unresolved);
   printf("\n");
-  
+
   if (unittest_results.total == unittest_results.pass + unittest_results.xfail)
     printf("Unit testing completed successfully!\n");
   else
index e21739dfee0a659ec8daa2c7af9b6e627603cbc7..3f8331ec06f76c54ca7970cd47053a42cd651af8 100644 (file)
@@ -14,22 +14,22 @@ function result = unit_test(test_title, expect_pass, actual_result)
   ## A call to unit_test typically looks like this:
   ##
   ## unit_test("scalar integer addition", 1, eval("1 + 1 == 2;"));
-  
+
   global unittest_results;
-  
+
   ## Sanity check input parameters
   if ( nargin < 3 || nargin > 4 )
     error("Function run_rest expects 3 or 4 parameters.");
   endif
-  
+
   if (!ischar(test_title))
     error("Expecting TEST_TITLE (arg 1) to be a string.");
   endif
-  
+
   if (expect_pass != 0 && expect_pass != 1)
     error("Expecting EXPECT_PASS (arg 2) to be 0 or 1.");
   endif
-  
+
   unittest_results.total++;
 
   ## Take actions depending on what test result we expect
@@ -42,7 +42,7 @@ function result = unit_test(test_title, expect_pass, actual_result)
     endif
     return;
   endif
-  
+
   if (expect_pass == 1 && actual_result == 1)
     result = "PASS";
     if (unittest_results.verbose != 0)