Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2895_PushGP_GenealogyAnalysis/HeuristicLab.Tests/Interpreter/Expressions/PushProgramTests.cs @ 15903

Last change on this file since 15903 was 15771, checked in by bburlacu, 6 years ago

#2895: Add solution skeleton for PushGP with genealogy analysis.

File size: 1.3 KB
RevLine 
[15771]1using HeuristicLab.Problems.ProgramSynthesis;
2using Microsoft.VisualStudio.TestTools.UnitTesting;
[15017]3
[15771]4namespace HeuristicLab.Tests.Interpreter.Expressions {
[15017]5  [TestClass]
6  public class PushProgramTests : ExpressionTest {
7    [TestMethod]
8    [TestProperty("Time", "Short")]
9    [TestCategory("ExpressionTest")]
10    [TestCategory("PushProgramTests")]
11    public void TotalCountTest() {
12      var program = PushParser.ParseProgram("( 5 ( INTEGER.DUP FLOAT.+ FLOAT.- ) ( EXEC.DO ( EXEC.IF ) EXEC.Y ) INTEGER.+ )");
13
14      Assert.AreEqual(12, program.TotalCount);
15    }
16
17    [TestMethod]
18    [TestProperty("Time", "Short")]
19    [TestCategory("ExpressionTest")]
20    [TestCategory("PushProgramTests")]
21    public void DepthTest() {
22      var program = PushParser.ParseProgram("( 5 ( INTEGER.DUP FLOAT.+ FLOAT.- ) ( EXEC.DO ( EXEC.IF ) EXEC.Y ) INTEGER.+ )");
23
24      Assert.AreEqual(3, program.Depth);
25    }
26
27    [TestMethod]
28    [TestProperty("Time", "Short")]
29    [TestCategory("ExpressionTest")]
30    [TestCategory("PushProgramTests")]
31    public void BranchesTest() {
32      var program = PushParser.ParseProgram("( 5 ( INTEGER.DUP FLOAT.+ FLOAT.- ) ( EXEC.DO ( EXEC.IF ) EXEC.Y ) INTEGER.+ )");
33
34      Assert.AreEqual(4, program.Branches);
35    }
36  }
37}
Note: See TracBrowser for help on using the repository browser.