Invalid DOS commands should fail with Syntax Error. Resolves #13

This commit is contained in:
Joshua Bell 2016-09-17 18:17:34 -07:00
parent 7b7a5e4a6b
commit 78428020d8
2 changed files with 12 additions and 3 deletions

7
dos.js
View File

@ -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);
}
}

View File

@ -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