コード例 #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();
                }
            }
        }