TestMoreFeaturesImpl.mesa
The Compute Server side of the Summoner.
Last Edited by: Bob Hagmann, May 3, 1985 9:09:45 am PDT
Copyright © 1984 by Xerox Corporation. All rights reserved.
DIRECTORY
Basics,
BasicTime,
Commander,
ComputeServerControl,
FS,
List,
IO,
ProcessProps,
Rope;
TestMoreFeaturesImpl: CEDAR PROGRAM
IMPORTS BasicTime, ComputeServerControl, FS, IO
= BEGIN
Variable Declarations
STREAM: TYPE = IO.STREAM;
ROPE: TYPE = Rope.ROPE;
Test Code
testMoreFeatures: Commander.CommandProc = {
in: STREAM = cmd.in;
out: STREAM = cmd.out;
err: STREAM = cmd.err;
commandLine: ROPE ← cmd.commandLine;
smallFileToCat, writeTime, readTime: STREAM;
now: BasicTime.GMT;
smallFileToCat ← FS.StreamOpen["GlobalSmallFileToCat.txt"];
out.Put[IO.rope["
Type GlobalSmallFileToCat on stdout
"]];
DO
out.PutChar[smallFileToCat.GetChar[! IO.EndOfStream => EXIT]];
ENDLOOP;
smallFileToCat.Close[];
writeTime ← FS.StreamOpen["WriteTimeTest.file", $create];
now ← BasicTime.Now[];
writeTime.Put[IO.time[now]];
writeTime.Close[];
readTime ← FS.StreamOpen["WriteTimeTest.file"];
out.Put[IO.rope["
Time written to file is:
"], IO.time[now], IO.rope["
Time read from file is:
"]];
DO
out.PutChar[readTime.GetChar[! IO.EndOfStream => EXIT]];
ENDLOOP;
readTime.Close[];
out.Put[IO.rope["

The tests are all done "]];
};
ComputeServerControl.Register[key: "SummonerTestFeatures2", version: "1", proc: testMoreFeatures, doc: NIL, clientData: NIL];
END.