コード例 #1
0
        private static string RunAndCollectOutput(ZMachine zm, TestCaseIO io)
        {
            string output = null;

            try
            {
                zm.PredictableRandom = true;
                zm.Run();
                output = io.CollectOutput();
            }
            catch (Exception ex)
            {
                if (output == null)
                {
                    output = io.CollectOutput();
                }

                output += "\n\n*** Exception ***\n" + ex.ToString();
            }

            return(output);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: dbremner/zlr
        private static string RunAndCollectOutput(ZMachine zm, TestCaseIO io)
        {
            string output = null;

            try
            {
                zm.PredictableRandom = true;
                zm.Run();
                output = io.CollectOutput();
            }
            catch (Exception ex)
            {
                if (output == null)
                    output = io.CollectOutput();

                output += "\n\n*** Exception ***\n" + ex.ToString();
            }

            return output;
        }