Skip to content

Editor test harness - #126

Merged
dmsc merged 15 commits into
masterfrom
editor-tests-v2
Oct 19, 2026
Merged

dmsc merged 15 commits into
masterfrom
editor-tests-v2

Conversation

@dmsc

@dmsc dmsc commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Add a new test harness for the editor.

dmsc added 15 commits October 18, 2026 19:42
Update the mini65 submodule and build the new editor module.

Add atedit.c to the test build source list, and make editor tests
depend on the IDE binaries.

Full editor mode is now the default, which changes E: semantics in
existing tests:

- CLS homes the cursor to row 0 / left margin.  The test harness pins
  LMARGN to 0, so stmt-cls now reports the plot at (0,0).
- After E: input, the editor moves the cursor to the next line at the
  left margin, whereas the old stream mode left COLCRS after the "?"
  prompt.  Update the two INPUT expectations accordingly.

All 83 non-editor tests pass.
Editor tests are defined by their .chk file and need no paired .bas
source.  The initial editor buffer is declared with a Document: key:

  Document: none                 empty HELP.TXT (default)
  Document:                      inline section, terminated by "."
  Document: <file>               ASCII fixture from the test directory

Document: is rejected for non-editor tests.

Each editor run gets its own DOS root, build/tests/<tag>/, and all
generated files stay under build/.  The directory is created by fbtest
and checked files are removed before the run.

The harness also gains:

- readable Input notation (^X, <NAME>, \xHH, UTF-8 ATASCII glyphs);
- editor-only trimming of the final Input EOL, so normal run tests
  keep their exact input bytes;
- Screen: assertions, compared byte-exactly against the emulated E:
  screen buffer;
- direct use of atari_screen_get(), which now includes the visible
  cursor glyph, instead of XORing the cursor cell again;
- build-only FB_DUMP_SCREEN and FB_DUMP_OUTPUT debug dumps;
- input EOF termination for editor scripts.

Add the first editor tests: line split and two screen tests.  The
status line now correctly fills all 40 columns, so the expected first
row gains its last inverse-video cell.
Exercise the editor output and file assertions: type a program at the
top of the initial document, compile and run it with Ctrl-R, save the
XEX with Ctrl-W, and quit discarding changes.

Check for the compiler "Parsing" message, the program marker on the
captured output, and the saved T2.XEX in the per-test DOS root.
Add tests for Ctrl-G to lines 0, 1, 5, 30 and 99, including the
RETURN that executes the jump.  They share one 33-line document
fixture instead of duplicating the same text in five source files.

Add the horizontal scroll test, which types Ctrl-E and moves the
cursor left over a 50-character line.
Add editor tests for split/join, delete and insert line, delete to EOF,
copy/paste, undo, backspace at the start, an empty final line and
typing at the 255-character limit.

Use the readable Input notation for control keys, so the intent of each
script is visible.

The wrapped-line tests now expect the right-arrow marker that the
FastBasic editor places in the last column to show that the line
continues.
Add tests for a parse error on Ctrl-R, both at the start of the file
and after scrolling to the error line.
Describe .chk-only editor tests and the Document: key, per-test DOS
roots, input notation, editor-only EOF handling, Screen: assertions,
cursor rendering, wrap markers, and build-only debug dumps.
Add a named notation for the ATASCII EOL/RETURN byte and use it in
editor scripts that explicitly press RETURN.  Newlines in Input still
imply RETURN; the named form makes explicit key presses visible.

Use the readable notation for the scroll test's Ctrl-E and arrow keys
as well.
Allow # comments in .chk headers and add a Cursor: row,col assertion,
read from the emulated ROWCRS/COLCRS variables after the run.

Use it in a few existing tests, and document the known Ctrl-G 0 bug
and the intent of ed-del-eof.
Add tests for Ctrl-A, Ctrl-E, left/right boundaries, page up/down and
scrolling at the top and bottom of the screen.  Assert both the screen
and the cursor via ROWCRS/COLCRS.

The page tests document the current 20-line movement; the manual says
19 lines, which is left for a later decision.
Add tests for RETURN at column 0, at EOL and at the bottom row, real
backspace and delete-character edits, deleting first/last/only lines,
and accepting one character on a 254-character line.

Assert both the screen and the cursor position.
Add tests for Ctrl-S save, Ctrl-L load, Ctrl-N new, discarding changes
on new, the load error path, the quit save prompt and editing a
filename in the save prompt.

Save tests verify the complete source file with Check.
Add tests for ESC verbatim input, inverse/graphical characters,
undo after delete, copying before the mark, an 80-column scrolled
line, returning the horizontal window to column 0, and a parse error
on line 1.
Each test writes build/tests/.fbtest-manifest-<name> from the
declarations in its .chk file.  Editor tests list HELP.TXT, every
Files: copy, every Check:/Exists: file and the test directory; normal
tests list their Check:/Exists: files.  The opt-in .screen and .output
debug dumps are included as known harness outputs.

make clean reads those manifests and removes only the listed files.
Editor test directories are removed with rmdir, so user files left in
them are preserved.  Manifests are written in binary mode so cleanup
works on Windows with the MSYS shell tools already required by the
Makefile.

Check: and Exists: now work for normal tests as well as editor tests.
Use this to verify the complete D:XXX output of the diskio test and
record it in the manifest.
Use a private xstrndup helper instead of defining strndup, which is
now declared by newer MinGW headers.
@dmsc
dmsc merged commit e8fbc7c into master Oct 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant