home *** CD-ROM | disk | FTP | other *** search
- '************************** FILETEST.MST *********************************
- 'Demonstrates: Some of the file-handling procedures of FastTest.
- '
- 'Required Files: FASTTEST.INC, NOTEPAD.EXE
- '
- 'Uses: FASTTEST
- '
- 'Complexity Level: INTRODUCTORY
- '
- 'Notes: Assumes disk is in drive A:
- '
- '*************************************************************************
-
- '$INCLUDE 'FASTTEST.INC'
-
- XSetLogOptions LOG_SCREEN '*** Output errors to the viewport
- Viewport Clear '*** Clear the viewport screen
- XSetTerminate FALSE '*** Continue after a failure is logged
-
- XLogBanner "Starting Notepad Test"
-
- XChangeDrive "A:" '*** Change current drive to A:
- '*** If the file TESTOUT.TXT already exists on A:, delete it:
-
- XDeleteFileIfExists "testout.txt"
-
- '*** Create a baseline comparison file (base.txt) on A:.
- '*** XCreateFile creates the file and inserts the first line
- '*** XAppendFile appends the second line to the file
-
- XCreateFile "base.txt","First line of text"
- XAppendFile "base.txt","Ssecond line of text"
-
- '*** Start Notepad and type two lines of text into the window:
-
- XStartApp "notepad.exe", ""
- XEnter "First line of text"
- XEnter "Second line of text"
-
- XAlt "f" '*** Open the File menu
- XKey "s" '*** Choose the Save command
-
- XText "testout.txt" '*** Enter the filename to save as
- XEnter "" '*** Press Enter to select the OK button
-
- '*** Exit Notepad by entering Alt+f, then x:
-
- XAlt "f"
- XKey "x"
-
- '*** Compare base.txt and testout.txt and
- '*** log an error if they are not identical:
-
- XFileCmp "base.txt","testout.txt"
-
- '*** Delete both files - they are no longer needed
-
- XDeleteFile "testout.txt"
- XDeleteFile "base.txt"
-
- XChangeDrive "C:" '*** Change current drive back to C:
-
- END
-
-