01: /*
02: * TestsetplatformCmd.java --
03: *
04: * This file contains the Jacl implementation of the built-in Tcl test
05: * commands: testsetplatform.
06: *
07: * Copyright (c) 1997 Sun Microsystems, Inc.
08: *
09: * See the file "license.terms" for information on usage and
10: * redistribution of this file, and for a DISCLAIMER OF ALL
11: * WARRANTIES.
12: *
13: * RCS: @(#) $Id: TestsetplatformCmd.java,v 1.1 1999/05/10 04:08:52 dejong Exp $
14: *
15: */
16:
17: package tcl.lang;
18:
19: /*
20: * This class implements the built-in test command: testsetplatform.
21: */
22:
23: class TestsetplatformCmd implements Command {
24:
25: static Class procClass = null;
26:
27: static final private String validCmds[] = { "unix", "windows",
28: "mac" };
29:
30: /*
31: *----------------------------------------------------------------------
32: *
33: * CmdProc --
34: *
35: * This procedure is invoked to process the "testsetplatform" Tcl command.
36: * This command is only used in the test suite.
37: *
38: * Results:
39: * None.
40: *
41: * Side effects:
42: * From now on, the "fileCmd" object will behave as though we are running
43: * on the platform specified in this procedure call.
44: *
45: *----------------------------------------------------------------------
46: */
47:
48: public void cmdProc(Interp interp, // Current interp to eval the file cmd.
49: TclObject argv[]) throws TclException {
50: if (argv.length != 2) {
51: throw new TclNumArgsException(interp, 1, argv, "platform");
52: }
53:
54: JACL.PLATFORM = TclIndex.get(interp, argv[1], validCmds,
55: "platform", 0);
56: interp.setResult("");
57: return;
58: }
59:
60: } // end class TestsetplatformCmd
|