Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example test demonstrating failure for 2858 #2859

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,35 @@ public void KindString()
Assert.Equal("Record (TestType)", _lazyRecord1._type.GetKindString());
}

[Fact]
public void Log()
{
_getter1CalledCount = 0;

var symbols = new SymbolTable();
symbols.AddVariable("r", _lazyRecord1);

var check = new CheckResult(new Engine())
.SetText("r.Foo * 2")
.SetBindingInfo(symbols);

int c1 = _getter1CalledCount;
Assert.Equal(0, c1);

// This will parse, bind and do work.
check.ApplyErrors();
int c2 = _getter1CalledCount;
Assert.Equal(1, c1 + 1); // only does 1 lookup based on the expression.

Assert.True(check.IsSuccess);

// Logging shouldn't make any more calls.
var log = check.ApplyGetLogging();

int c3 = _getter1CalledCount;
Assert.Equal(c2, c3);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this assert fails. Bug is to fix this.

}

[Fact]
public void AcceptsSimple()
{
Expand Down
Loading