# HG changeset patch # User John W. Eaton # Date 1713292385 14400 # Node ID ea29311fbd44ff298416e48d825f71e27aaedeba # Parent 8643f7ca95044f75fc62b4632f8581e48770c163 rename some files for consistency Prefer hyphens over underscores in filenames. * test/compile/shutup-operator-test/@double/display.m: Rename from test/compile/shutup_operator_test/@double/display.m. * test/compile/shutup-operator-test/@logical/display.m: Rename from test/compile/shutup_operator_test/@logical/display.m. * test/compile/shutup-operator-test/bytecode-disp.tst: Rename from test/compile/shutup_operator_test/bytecode_disp.m. * test/compile/shutup-operator-test/bytecode_disp.m: Rename from test/compile/shutup_operator_test/bytecode_disp.tst. * test/compile/module.mk: Update. diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/module.mk --- a/test/compile/module.mk Tue Apr 16 14:24:48 2024 -0400 +++ b/test/compile/module.mk Tue Apr 16 14:33:05 2024 -0400 @@ -55,9 +55,9 @@ %reldir%/script2.m \ %reldir%/script3.m \ %reldir%/shutup_operator_test/@double/display.m \ - %reldir%/shutup_operator_test/@logical/display.m \ - %reldir%/shutup_operator_test/bytecode_disp.m \ - %reldir%/shutup_operator_test/bytecode_disp.tst \ + %reldir%/shutup-operator-test/@logical/display.m \ + %reldir%/shutup-operator-test/bytecode_disp.m \ + %reldir%/shutup-operator-test/bytecode-disp.tst \ %reldir%/wrongname_fn.m TEST_FILES += $(compile_TEST_FILES) diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup-operator-test/@double/display.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compile/shutup-operator-test/@double/display.m Tue Apr 16 14:33:05 2024 -0400 @@ -0,0 +1,11 @@ +% For use by bytecode_disp(). +% +% Overload display +% +function display (x) + if (inputname(1)) + __printf_assert__ ("%s = %d ", inputname(1), x); + else + __printf_assert__ ("%d ", x); + end +end diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup-operator-test/@logical/display.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compile/shutup-operator-test/@logical/display.m Tue Apr 16 14:33:05 2024 -0400 @@ -0,0 +1,11 @@ +% For use by bytecode_disp(). +% +% Overload display +% +function display (x) + if (inputname(1)) + __printf_assert__ ("%s = %d ", inputname(1), x); + else + __printf_assert__ ("%d ", x); + end +end diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup-operator-test/bytecode-disp.tst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compile/shutup-operator-test/bytecode-disp.tst Tue Apr 16 14:33:05 2024 -0400 @@ -0,0 +1,18 @@ +## Test display due to no ";" at eol +## +## We are overloading display for double so we place this test +## in its own folder to not mess double up for the other +## tests. + +%!testif ENABLE_BYTECODE_EVALUATOR +%! % Overloading of class-methods seems to stick so we need to clear them since we overload +%! % double's display. Is this a bug ??? +%! clear classes +%! key = "ans = 1 . ans = 5 . . ans = 0 . ans = 8 . ans = 3 . x = 3 . x = 1 y = 2 . x = 1 . . x = 1 . y = 2 . x = 1 "; +%! __vm_compile__ bytecode_disp clear; +%! bytecode_disp; +%! assert (__prog_output_assert__ (key)); +%! +%! assert (__vm_compile__ ("bytecode_disp")); +%! bytecode_disp; +%! assert (__prog_output_assert__ (key)); diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup-operator-test/bytecode_disp.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/compile/shutup-operator-test/bytecode_disp.m Tue Apr 16 14:33:05 2024 -0400 @@ -0,0 +1,38 @@ +function bytecode_disp() + % int8 type's display is overloaded with a __printf_assert__ + 1 % "ans = 1" + print_dot; + 2 + 3 % "ans = 5" + print_dot; + 0; % + 0 + 0; % + print_dot; + ~4 % "ans = 0" + print_dot; + 2^3 % "ans = 8" + print_dot % + + if 2 + 3 % "ans = 3" + end + print_dot; + x = 4 - 1 % "x = 3" + + print_dot; + [x, y] = deal (1,2) % "x = 1" "y = 2" + print_dot; + [x, ~] = deal (1,2) % "x = 1" + print_dot; + % If all lvalues are black holes, nothing is printed + [~, ~] = deal (1,2) % + print_dot; + [x, ~, ~] = deal (1,2, 3) % "x = 1" + print_dot; + [~, y, ~] = deal (1,2, 3) % "y = 2" + print_dot; + x +end + +function print_dot() + __printf_assert__(". "); +end diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup_operator_test/@double/display.m --- a/test/compile/shutup_operator_test/@double/display.m Tue Apr 16 14:24:48 2024 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -% For use by bytecode_disp(). -% -% Overload display -% -function display (x) - if (inputname(1)) - __printf_assert__ ("%s = %d ", inputname(1), x); - else - __printf_assert__ ("%d ", x); - end -end diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup_operator_test/@logical/display.m --- a/test/compile/shutup_operator_test/@logical/display.m Tue Apr 16 14:24:48 2024 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -% For use by bytecode_disp(). -% -% Overload display -% -function display (x) - if (inputname(1)) - __printf_assert__ ("%s = %d ", inputname(1), x); - else - __printf_assert__ ("%d ", x); - end -end diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup_operator_test/bytecode_disp.m --- a/test/compile/shutup_operator_test/bytecode_disp.m Tue Apr 16 14:24:48 2024 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -function bytecode_disp() - % int8 type's display is overloaded with a __printf_assert__ - 1 % "ans = 1" - print_dot; - 2 + 3 % "ans = 5" - print_dot; - 0; % - 0 + 0; % - print_dot; - ~4 % "ans = 0" - print_dot; - 2^3 % "ans = 8" - print_dot % - - if 2 - 3 % "ans = 3" - end - print_dot; - x = 4 - 1 % "x = 3" - - print_dot; - [x, y] = deal (1,2) % "x = 1" "y = 2" - print_dot; - [x, ~] = deal (1,2) % "x = 1" - print_dot; - % If all lvalues are black holes, nothing is printed - [~, ~] = deal (1,2) % - print_dot; - [x, ~, ~] = deal (1,2, 3) % "x = 1" - print_dot; - [~, y, ~] = deal (1,2, 3) % "y = 2" - print_dot; - x -end - -function print_dot() - __printf_assert__(". "); -end diff -r 8643f7ca9504 -r ea29311fbd44 test/compile/shutup_operator_test/bytecode_disp.tst --- a/test/compile/shutup_operator_test/bytecode_disp.tst Tue Apr 16 14:24:48 2024 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -## Test display due to no ";" at eol -## -## We are overloading display for double so we place this test -## in its own folder to not mess double up for the other -## tests. - -%!testif ENABLE_BYTECODE_EVALUATOR -%! % Overloading of class-methods seems to stick so we need to clear them since we overload -%! % double's display. Is this a bug ??? -%! clear classes -%! key = "ans = 1 . ans = 5 . . ans = 0 . ans = 8 . ans = 3 . x = 3 . x = 1 y = 2 . x = 1 . . x = 1 . y = 2 . x = 1 "; -%! __vm_compile__ bytecode_disp clear; -%! bytecode_disp; -%! assert (__prog_output_assert__ (key)); -%! -%! assert (__vm_compile__ ("bytecode_disp")); -%! bytecode_disp; -%! assert (__prog_output_assert__ (key));