Changeset 18168


Ignore:
Timestamp:
12/26/21 21:14:52 (6 months ago)
Author:
gkronber
Message:

#2938 changed the expected outputs to reflect the expected behaviour

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/InfixExpressionParserTest.cs

    r18167 r18168  
    6161
    6262      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 output
     63      Assert.AreEqual("LOG(-3)",formatter.Format(parser.Parse("log(-3)")));
    6464      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 output
     65      Assert.AreEqual("EXP(-3)",formatter.Format(parser.Parse("exp(-3)")));
    6666      Assert.AreEqual("SQRT(3)", formatter.Format(parser.Parse("sqrt(3)")));
    6767
    68       Assert.AreEqual("SQR((-(3)))", formatter.Format(parser.Parse("sqr((-3))")));  // should produce sqr((-3)) as output
     68      Assert.AreEqual("SQR(-3)", formatter.Format(parser.Parse("sqr((-3))")));
    6969
    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")));
    7472
    7573      Assert.AreEqual("'x1'",formatter.Format(parser.Parse("\"x1\"")));
     
    9189      Assert.AreEqual("(3.1 ^ 2.1)",formatter.Format(parser.Parse("POW(3.1 , 2.1)")));
    9290      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)")));
    9492      Assert.AreEqual("ROOT(3, 2)",formatter.Format(parser.Parse("ROOT(3, 2)")));
    9593      Assert.AreEqual("ROOT(3.1, 2.1)",formatter.Format(parser.Parse("ROOT(3.1, 2.1)")));
    9694      Assert.AreEqual("ROOT(3.1, 2.1)",formatter.Format(parser.Parse("ROOT(3.1 , 2.1)")));
    9795      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)")));
    9997
    10098      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.