- Timestamp:
- 03/20/18 13:49:19 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2886_SymRegGrammarEnumeration/Test/TreeHashingTest.cs
r15834 r15849 12 12 private TerminalSymbol varB; 13 13 private TerminalSymbol varC; 14 private TerminalSymbol c; 14 15 15 16 [TestInitialize] … … 20 21 varB = grammar.VarTerminals.First(s => s.StringRepresentation == "b"); 21 22 varC = grammar.VarTerminals.First(s => s.StringRepresentation == "c"); 23 c = grammar.Const; 22 24 } 23 25 … … 132 134 } 133 135 136 // Constants 137 [TestMethod] 138 [TestCategory("TreeHashing")] 139 public void SimpleConst() { 140 SymbolString s1 = new SymbolString(new Symbol[] { c, varA, grammar.Multiplication, c, grammar.Addition}); 141 SymbolString s2 = new SymbolString(new Symbol[] { c, varA, grammar.Multiplication, c, varA, grammar.Multiplication, grammar.Addition, c, grammar.Addition }); 142 143 int hash1 = grammar.Hasher.CalcHashCode(s1); 144 int hash2 = grammar.Hasher.CalcHashCode(s2); 145 146 Assert.AreEqual(hash1, hash2); 147 } 148 134 149 /* DEPRECATED; SINCE WE DO NOT ALLOW COMPOUND DIVISIONS 135 150 [TestMethod]
Note: See TracChangeset
for help on using the changeset viewer.