- Timestamp:
- 12/26/21 21:14:52 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/InfixExpressionParserTest.cs
r18167 r18168 61 61 62 62 Assert.AreEqual("LOG(3)",formatter.Format(parser.Parse("log(3)"))); 63 Assert.AreEqual("LOG( (-(3)))",formatter.Format(parser.Parse("log(-3)"))); // should produce log(-3) as output63 Assert.AreEqual("LOG(-3)",formatter.Format(parser.Parse("log(-3)"))); 64 64 Assert.AreEqual("EXP(3)",formatter.Format(parser.Parse("exp(3)"))); 65 Assert.AreEqual("EXP( (-(3)))",formatter.Format(parser.Parse("exp(-3)"))); // should produce exp(-3) as output65 Assert.AreEqual("EXP(-3)",formatter.Format(parser.Parse("exp(-3)"))); 66 66 Assert.AreEqual("SQRT(3)", formatter.Format(parser.Parse("sqrt(3)"))); 67 67 68 Assert.AreEqual("SQR( (-(3)))", formatter.Format(parser.Parse("sqr((-3))"))); // should produce sqr((-3)) as output68 Assert.AreEqual("SQR(-3)", formatter.Format(parser.Parse("sqr((-3))"))); 69 69 70 Assert.AreEqual("((3 * 1/3) + (2 * 1/2) + (1 * 1/1))",formatter.Format(parser.Parse("3/3+2/2+1/1"))); // ((3 * 1 / 3) + (2 * 1 / 2) + (1 * 1 / 1)) 71 Assert.AreEqual("(30 + 20 + 10 + ((-1) * (3 + 2 + 1)))", formatter.Format(parser.Parse("-3+30-2+20-1+10"))); // not (30 + 20 + 10 + ((-1) * (3 + 2 + 1))) 72 // round trip 73 Assert.AreEqual("(30 + 20 + 10 + ((-(1)) * (3 + 2 + 1)))", formatter.Format(parser.Parse(formatter.Format(parser.Parse("-3+30-2+20-1+10"))))); // not (30 + 20 + 10 + ((-(1)) * (3 + 2 + 1))) 70 Assert.AreEqual("((3/3) + (2/2) + (1/1))",formatter.Format(parser.Parse("3/3+2/2+1/1"))); 71 Assert.AreEqual("-3 + 30 - 2 + 20 - 1 + 10", formatter.Format(parser.Parse("-3+30-2+20-1+10"))); 74 72 75 73 Assert.AreEqual("'x1'",formatter.Format(parser.Parse("\"x1\""))); … … 91 89 Assert.AreEqual("(3.1 ^ 2.1)",formatter.Format(parser.Parse("POW(3.1 , 2.1)"))); 92 90 Assert.AreEqual("(3.1 ^ 2.1)",formatter.Format(parser.Parse("POW(3.1 ,2.1)"))); 93 Assert.AreEqual(" ((-(3.1)) ^ (-(2.1)))",formatter.Format(parser.Parse("POW(-3.1 , - 2.1)")));91 Assert.AreEqual("-3.1 ^ -2.1",formatter.Format(parser.Parse("POW(-3.1 , - 2.1)"))); 94 92 Assert.AreEqual("ROOT(3, 2)",formatter.Format(parser.Parse("ROOT(3, 2)"))); 95 93 Assert.AreEqual("ROOT(3.1, 2.1)",formatter.Format(parser.Parse("ROOT(3.1, 2.1)"))); 96 94 Assert.AreEqual("ROOT(3.1, 2.1)",formatter.Format(parser.Parse("ROOT(3.1 , 2.1)"))); 97 95 Assert.AreEqual("ROOT(3.1, 2.1)",formatter.Format(parser.Parse("ROOT(3.1 ,2.1)"))); 98 Assert.AreEqual("ROOT( (-(3.1)), (-(2.1)))", formatter.Format(parser.Parse("ROOT(-3.1 , - 2.1)")));96 Assert.AreEqual("ROOT(-3.1, -2.1)", formatter.Format(parser.Parse("ROOT(-3.1 , - 2.1)"))); 99 97 100 98 Assert.AreEqual("IF(GT(0, 1), 1, 0)",formatter.Format(parser.Parse("IF(GT( 0, 1), 1, 0)")));
Note: See TracChangeset
for help on using the changeset viewer.