示例#1
0
        private static void RecordExpectedOutcome()
        {
            TestCase selected = PromptForTestCase();

            if (selected != null)
            {
                try
                {
                    using (Stream zcode = selected.GetZCode())
                    {
                        RecordingIO io = new RecordingIO(selected.InputFile);
                        ZMachine    zm = new ZMachine(zcode, io);
                        zm.PredictableRandom     = true;
                        zm.WritingCommandsToFile = true;

                        string output = RunAndCollectOutput(zm, io);
                        File.WriteAllText(selected.OutputFile, output);
                    }
                }
                finally
                {
                    selected.CleanUp();
                }
            }
        }
示例#2
0
文件: Program.cs 项目: dbremner/zlr
        private static void RecordExpectedOutcome()
        {
            TestCase selected = PromptForTestCase();

            if (selected != null)
            {
                try
                {
                    using (Stream zcode = selected.GetZCode())
                    {
                        RecordingIO io = new RecordingIO(selected.InputFile);
                        ZMachine zm = new ZMachine(zcode, io);
                        zm.PredictableRandom = true;
                        zm.WritingCommandsToFile = true;

                        string output = RunAndCollectOutput(zm, io);
                        File.WriteAllText(selected.OutputFile, output);
                    }
                }
                finally
                {
                    selected.CleanUp();
                }
            }
        }