Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
b3b00 committed Jun 13, 2024
1 parent 4259982 commit 9ad4e80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ private MermaidNode Leaf(IN type, string value)
private MermaidNode Leaf(string value)
{
string label = "";
//var esc = value.Replace("\"", "\\\"");
label += $"'{value}'";
var node = new MermaidNode(NodeCounter.ToString())
{
Expand Down
14 changes: 7 additions & 7 deletions tests/ParserTests/ExpressionGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,30 +222,30 @@ public void TestBuild()
{
BuildParser();

Check.That(Parser.Result.Configuration.NonTerminals).CountIs(6);
Check.That(Parser.Result.Configuration.NonTerminals).CountIs(7);
var nonterminals = new List<NonTerminal<ExpressionToken>>();
foreach (var pair in Parser.Result.Configuration.NonTerminals) nonterminals.Add(pair.Value);
var nt = nonterminals[0]; // operand
var nt = nonterminals[1]; // operand
Check.That(nt.Rules).IsSingle();
Check.That(nt.Name).IsEqualTo("operand");
nt = nonterminals[1];
nt = nonterminals[2];
Check.That(nt.Rules).CountIs(3);
Check.That(nt.Name).Contains("primary_value");
nt = nonterminals[2];
nt = nonterminals[3];
Check.That(nt.Rules).IsSingle();
Check.That(nt.Name).Contains("10");
Check.That(nt.Name).Contains("PLUS");
Check.That(nt.Name).Contains("MINUS");
nt = nonterminals[3];
nt = nonterminals[4];
Check.That(nt.Rules).IsSingle();
Check.That(nt.Name).Contains("50");
Check.That(nt.Name).Contains("TIMES");
Check.That(nt.Name).Contains("DIVIDE");
nt = nonterminals[4];
nt = nonterminals[5];
Check.That(nt.Rules).CountIs(3);
Check.That(nt.Name).Contains("100");
Check.That(nt.Name).Contains("MINUS");
nt = nonterminals[5];
nt = nonterminals[6];
Check.That(nt.Rules).IsSingle();
Check.That(nt.Name).IsEqualTo(StartingRule);
Check.That(nt.Rules[0].Clauses).IsSingle();
Expand Down

0 comments on commit 9ad4e80

Please sign in to comment.