Permalink
Browse files

fixed erb-like trimming and StrFTime TimeZone test

  • Loading branch information...
1 parent b333e62 commit a345e07b7942a111a2054e3d04fec4ecc4c2e64b petrhaus committed Mar 27, 2012
Showing with 3 additions and 9 deletions.
  1. +2 −8 src/DotLiquid.Tests/Util/StrFTimeTests.cs
  2. +1 −1 src/DotLiquid/Template.cs
View
@@ -29,7 +29,8 @@ public class StrFTimeTests
[TestCase("%x", Result = "09/01/2012")]
[TestCase("%X", Result = "14:32:14")]
[TestCase("%y", Result = "12")]
- [TestCase("%Y", Result = "2012")]
+ [TestCase("%Y", Result = "2012")]
+ [TestCase("%Z", Result = "+01:00")]
[TestCase("%", Result = "%")]
public string TestFormat(string format)
{
@@ -39,12 +40,5 @@ public string TestFormat(string format)
Thread.CurrentThread.CurrentCulture = culture;
return result;
}
-
- [Test]
- public void TestTimeZone()
- {
- string timeZoneOffset = DateTime.Now.ToString("zzz");
- Assert.That(TestFormat("%Z"), Is.EqualTo(timeZoneOffset));
- }
}
}
View
2 src/DotLiquid/Template.cs 100644 → 100755
@@ -228,7 +228,7 @@ internal static List<string> Tokenize(string source)
if (string.IsNullOrEmpty(source))
return new List<string>();
- source = Regex.Replace(source, string.Format(@"-({0}|{1})(\n|\r\n)", Liquid.VariableEnd, Liquid.TagEnd), "$1");
+ source = Regex.Replace(source, string.Format(@"-({0}|{1})(\n|\r\n|[ \t]+)?", Liquid.VariableEnd, Liquid.TagEnd), "$1");
List<string> tokens = Regex.Split(source, Liquid.TemplateParser).ToList();

0 comments on commit a345e07

Please sign in to comment.