Tests.Tests.TestFunctionCallRestrictions C# (CSharp) Method

TestFunctionCallRestrictions() private method

private TestFunctionCallRestrictions ( ) : void
return void
        public void TestFunctionCallRestrictions()
        {
            CompileStringWithoutRuntime(@"
// Allowed to do this
~ myFunc()

// Not allowed to to this
~ aKnot()

// Not allowed to do this
-> myFunc

== function myFunc ==
This is a function.
~ return

== aKnot ==
This is a normal knot.
-> END
", testingErrors: true);

            Assert.AreEqual(2, _errorMessages.Count);
            Assert.IsTrue(_errorMessages[0].Contains("hasn't been marked as a function"));
            Assert.IsTrue(_errorMessages[1].Contains("can only be called as a function"));
        }
Tests