/* Test that std.ch #command rules expand correctly. */ PROCEDURE Main() LOCAL cName := "/tmp/__pp_test_std_ch.tmp" /* Create a junk file so ERASE/RENAME have something to work with. */ hb_MemoWrit( cName, "x" ) ? "1. file created exists?", File( cName ), "(expect .T.)" /* ERASE <(f)> → FErase(<(f)>) */ ERASE ( cName ) ? "2. after ERASE exists?", File( cName ), "(expect .F.)" /* RENAME — recreate, rename, check both. */ hb_MemoWrit( cName, "y" ) RENAME ( cName ) TO ( cName + ".moved" ) ? "3. after RENAME orig exists?", File( cName ), "(expect .F.)" ? " moved exists?", File( cName + ".moved" ), "(expect .T.)" FErase( cName + ".moved" ) /* DELETE FILE <(f)> alias for ERASE */ hb_MemoWrit( cName, "z" ) DELETE FILE ( cName ) ? "4. after DELETE FILE exists?", File( cName ), "(expect .F.)" /* CLOSE / CLOSE ALL / CLOSE DATABASES — should compile without hardcoded parser support. They each call DbCloseArea or DbCloseAll. With no open workareas, both are no-ops. */ CLOSE CLOSE ALL CLOSE DATABASES ? "5. CLOSE / CLOSE ALL / CLOSE DATABASES compiled OK" /* COMMIT — DbCommit() with no open area is a no-op too. */ COMMIT ? "6. COMMIT compiled OK" ? "DONE" RETURN