diff --git a/dos.js b/dos.js index 0db332c..23e8d2a 100644 --- a/dos.js +++ b/dos.js @@ -21,7 +21,10 @@ function DOS(tty) { NO_BUFFERS_AVAILABLE: [12, 'No buffers available'], FILE_TYPE_MISMATCH: [13, 'File type mismatch'], PROGRAM_TOO_LARGE: [14, 'Program too large'], - NOT_DIRECT_COMMAND: [15, 'Not direct command'] + NOT_DIRECT_COMMAND: [15, 'Not direct command'], + + // Re-used + SYNTAX_ERROR: [16, "Syntax error"] }, STORAGE_PREFIX = 'vfs/', @@ -368,7 +371,7 @@ function DOS(tty) { activebuffer = null; mode = ""; } else { - doserror(DOSErrors.INVALID_OPTION); + doserror(DOSErrors.SYNTAX_ERROR); } } diff --git a/samples/sample.unittests.txt b/samples/sample.unittests.txt index 506d9c8..83e181a 100644 --- a/samples/sample.unittests.txt +++ b/samples/sample.unittests.txt @@ -881,7 +881,7 @@ 18091 T = 1 18093 S = (T = 2) : GOSUB 1 -18100 T$ = "Output Hook Precedence +18100 T$ = "Output Hook Precedence" : A$ = "abc" + CHR$(7) + "xyz" : PRINT CHR$(4)"OPEN TESTDATA" : PRINT CHR$(4)"WRITE TESTDATA" @@ -893,6 +893,12 @@ : PRINT CHR$(4)"CLOSE TESTDATA" : S = (A$ = B$) : GOSUB 1 +18110 T$ = "Invalid DOS Command" +: T = 1 : ONERR GOTO 18112 +18111 PRINT CHR$(4);CHR$(5) +: T = 2 +18112 S = (T=1) AND (PEEK(222)=16) : GOSUB 1 + 20000 PRINT : PRINT : PRINT "Executed tests: "; TE 20010 PRINT "Successful tests: "; TS 20019 IF F THEN INVERSE