Cleanup tests

This commit is contained in:
Carsten Larsen 2017-02-02 22:57:26 +01:00
parent 3484c33762
commit cc085c83e7
1 changed files with 6 additions and 3 deletions

View File

@ -76,9 +76,9 @@ void TestProgram::RunTests()
RunTestset2(); RunTestset2();
RunTestset3(); RunTestset3();
RunTestset4(); RunTestset4();
RunTestset5();
RunTestset6(); RunTestset6();
RunTestset7(); RunTestset7();
RunTestset5();
} }
void TestProgram::TestExpression(const char* expression, const char* result) void TestProgram::TestExpression(const char* expression, const char* result)
@ -331,12 +331,13 @@ void TestProgram::RunTestset4()
void TestProgram::RunTestset5() void TestProgram::RunTestset5()
{ {
TestExecution("delete funtions");
TestStatement("f(x)=x*2+1", ""); TestStatement("f(x)=x*2+1", "");
TestStatement("g(y)=y^2+y*1.5+2", ""); TestStatement("g(y)=y^2+y*1.5+2", "");
TestStatement("h(x)=|x^3-2*x^2-16*x+6|", ""); TestStatement("h(x)=x^3-2*x^2-16*x+6", "");
TestStatement("a=2;b=3;c=a+b;", ""); TestStatement("a=2;b=3;c=a+b;", "");
TestStatement("vars", "a = 2" NEWLINE "b = 3" NEWLINE "c = 5"); TestStatement("vars", "a = 2" NEWLINE "b = 3" NEWLINE "c = 5");
TestStatement("funcs", "f(x)=x*2+1" NEWLINE "g(y)=y^2+y*1.5+2" NEWLINE "h(x)=|x^3-2*x^2-16*x+6|"); TestStatement("funcs", "f(x)=x*2+1" NEWLINE "g(y)=y^2+y*1.5+2" NEWLINE "h(x)=x^3-2*x^2-16*x+6");
TestStatement("f(2.2)", "f(2.2) = 5.4"); TestStatement("f(2.2)", "f(2.2) = 5.4");
TestStatement("h(8.3)", "h(8.3) = 307.207"); TestStatement("h(8.3)", "h(8.3) = 307.207");
TestStatement("c+1.1", "c+1.1 = 6.1"); TestStatement("c+1.1", "c+1.1 = 6.1");
@ -345,6 +346,8 @@ void TestProgram::RunTestset5()
TestStatement("eval d=d+1", "d=(d+1) = 3.1"); TestStatement("eval d=d+1", "d=(d+1) = 3.1");
TestStatement("eval d=d*2", "d=(d*2) = 6.2"); TestStatement("eval d=d*2", "d=(d*2) = 6.2");
TestStatement("vars", "a = 2" NEWLINE "b = 3" NEWLINE "c = 5" NEWLINE "d = 6.2"); TestStatement("vars", "a = 2" NEWLINE "b = 3" NEWLINE "c = 5" NEWLINE "d = 6.2");
TestExecution("delete funtions");
TestExecution("delete variable");
} }
void TestProgram::RunTestset6() void TestProgram::RunTestset6()