trueagi-io / metta-wam

A Hyperon MeTTa Interpreter/Transpilier that targets the Warren Abstract Machine
8 stars 11 forks source link

Inconsistent Formatting of Test Case Headers in `metta_testing.pl` #86

Closed TeamSPoon closed 1 month ago

TeamSPoon commented 2 months ago

The current implementation of metta_testing.pl has an inconsistency in formatting test case headers when generating the output. The function print_current_test/0 is responsible for printing the current test header with a specific format. However, the lack of a newline (~N) before the formatted header can cause the output to appear cluttered, especially when running multiple tests sequentially.

Required Action:

Update the format/3 call in the print_current_test/0 function to ensure there is a clear break before each test header by adding a newline. This will improve the readability of test output and ensure consistent formatting.

Steps to Take:

  1. Modify the print_current_test/0 function in metta_testing.pl by adding a newline before the test header:

    - get_test_name(Number,TestName),format(';<h3 id="~w">;; ~w</h3>~n',[TestName,TestName]).
    + get_test_name(Number,TestName),format('~N~n;<h3 id="~w">;; ~w</h3>~n',[TestName,TestName]).
  2. The ~N~n ensures that a newline is inserted before the header, making the output visually distinct and easier to read.

Why This Change Is Necessary:

Make this change to ensure the test case outputs are consistently formatted and easy to interpret, regardless of the testing environment.