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
base: master
Are you sure you want to change the base?
Conversation
ca50396
to
ee82a5f
Compare
Codecov ReportBase: 88.26% // Head: 88.26% // No change to project coverage 👍
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
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. |
@@ -96,6 +96,21 @@ public string ReadTemplateFile(Context context, string templateName) | |||
} | |||
} | |||
|
|||
private class DictionaryFileSystem : IFileSystem |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
We should fix #271 at the same time. @hieuvuvan are you able to work on this? |
No description provided.