Skip to content

Tests for the VFP menu functions - #2162

Merged
RobertvanderHulst merged 1 commit into
devfrom
feature/vfp-menu-function-tests
Nov 8, 2026
Merged

RobertvanderHulst merged 1 commit into
devfrom
feature/vfp-menu-function-tests

Conversation

@Irwin1985

Copy link
Copy Markdown
Contributor

I added tests for the menu functions (BAR, PAD, POPUP, MENU, MRKBAR, MRKPAD, PRMBAR, PRMPAD) using menus built with the DEFINE commands, and compared the results with VFP 9.

While writing them I found a few problems, so they're fixed here as well:

  • The plain forms of DEFINE POPUP, DEFINE BAR, DEFINE PAD, DEFINE MENU and ACTIVATE POPUP weren't expanded by the header, and ON SELECTION ... DO proc didn't compile.
  • RELEASE MENUS and RELEASE POPUPS with a list of names didn't compile either.
  • PRMBAR() and MRKBAR() used the position of the bar instead of its number, so separators and gaps in the numbering gave the wrong bar. BAR() now returns the number too.
  • PRMBAR() and PRMPAD() return the prompt without the < marker.
  • Menu, popup and pad names are no longer case sensitive.
  • RELEASE MENUS left the menu registered.
  • PAD() and MENU() came back empty when the bar was selected without opening the menu first.

Unknown names still return an empty string or .F. instead of raising an error like VFP does. That's how the existing tests expect it, so I left it that way.

Tests for BAR, PAD, POPUP, MENU, MRKBAR, MRKPAD, PRMBAR and PRMPAD using
menus built with the DEFINE commands, checked against VFP 9. They found a
few problems that are fixed here too: the plain DEFINE and ACTIVATE POPUP
forms weren't expanded by the header, RELEASE MENUS/POPUPS with a list
didn't compile, PRMBAR/MRKBAR/BAR used the bar position instead of its
number, prompts kept the \< marker, names were case sensitive, RELEASE
MENUS left the menu registered and PAD()/MENU() were empty when the bar
was selected without opening the menu.
@RobertvanderHulst
RobertvanderHulst merged commit 7391551 into dev Nov 8, 2026
1 check passed
@RobertvanderHulst
RobertvanderHulst deleted the feature/vfp-menu-function-tests branch November 8, 2026 13:47
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.

2 participants