Exemplo n.º 1
0
        public void Outputs([NotNull] string expectedValue)
        {
            var testCode = $"{GlobalCode()}\r\n" +
                           $"<ROUTINE GO () {Expression()}>";

            ZlrHelper.RunAndAssert(testCode, input.ToString(), expectedValue, warningChecks, wantCompileOutput);
        }
Exemplo n.º 2
0
        public void GivesNumber([NotNull] string expectedValue)
        {
            var testCode = $"{GlobalCode()}\r\n" +
                           $"<ROUTINE GO () <PRINTN {Expression()}>>";

            ZlrHelper.RunAndAssert(testCode, input.ToString(), expectedValue, warningChecks);
        }
Exemplo n.º 3
0
        public void Implies([ItemNotNull][NotNull] params string[] conditions)
        {
            var sb = new StringBuilder();

            foreach (var c in conditions)
            {
                sb.AppendFormat(
                    "<COND ({0}) (T <INC FAILS> <PRINTI \"FAIL: {1}|\">)>\r\n",
                    c,
                    c.Replace("\\", "\\\\").Replace("\"", "\\\""));
            }

            var testCode =
                $"{GlobalCode()}\r\n" +
                $"<ROUTINE TEST-IMPLIES (\"AUX\" FAILS) {sb} .FAILS>\r\n" +
                "<ROUTINE GO () <OR <TEST-IMPLIES> <PRINTI \"PASS\">>>";

            ZlrHelper.RunAndAssert(testCode, input.ToString(), "PASS", warningChecks);
        }
Exemplo n.º 4
0
 public void Outputs([NotNull] string expectedValue)
 {
     ZlrHelper.RunAndAssert(code, null, expectedValue);
 }