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

include tag should not loop if string variable #515

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hieuvuvan
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Base: 88.26% // Head: 88.26% // No change to project coverage 👍

Coverage data is based on head (ee82a5f) compared to base (aaa5026).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #515   +/-   ##
=======================================
  Coverage   88.26%   88.26%           
=======================================
  Files          69       69           
  Lines        2676     2676           
  Branches      620      620           
=======================================
  Hits         2362     2362           
  Misses        210      210           
  Partials      104      104           
Impacted Files Coverage Δ
src/DotLiquid/Tags/Include.cs 95.34% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -96,6 +96,21 @@ public string ReadTemplateFile(Context context, string templateName)
}
}

private class DictionaryFileSystem : IFileSystem
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the same tests can be achieved with the existing TestFileSystem. Not sure why we need to recreate the wheel.

}), () =>
{
Assert.AreEqual("Product: foo", Template.Parse("{% include 'product' with 'foo' %}").Render());
Assert.AreEqual("Product: foo", Template.Parse("{% include 'product' for 'foo' %}").Render());
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest another test where string is not hard-coded and is a variable from hash.

@@ -224,5 +252,19 @@ public void TestIncludeFromTemplateFileSystem()
}
Assert.AreEqual(fileSystem.CacheHitTimes, 1);
}

public void WithFileSystem(IFileSystem fs, Action action)
Copy link
Contributor

Choose a reason for hiding this comment

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

If we need this we should probably move to the Helper class and do a proper lock like there is in LockTemplateStaticVars

@microalps
Copy link
Contributor

We should fix #271 at the same time. @hieuvuvan are you able to work on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants