Skip to content
This repository
Browse code

fixed erb-like trimming and StrFTime TimeZone test

  • Loading branch information...
commit a345e07b7942a111a2054e3d04fec4ecc4c2e64b 1 parent b333e62
Alessandro Petrelli petrhaus authored
10 src/DotLiquid.Tests/Util/StrFTimeTests.cs 100644 → 100755
@@ -29,7 +29,8 @@ public class StrFTimeTests
29 29 [TestCase("%x", Result = "09/01/2012")]
30 30 [TestCase("%X", Result = "14:32:14")]
31 31 [TestCase("%y", Result = "12")]
32   - [TestCase("%Y", Result = "2012")]
  32 + [TestCase("%Y", Result = "2012")]
  33 + [TestCase("%Z", Result = "+01:00")]
33 34 [TestCase("%", Result = "%")]
34 35 public string TestFormat(string format)
35 36 {
@@ -39,12 +40,5 @@ public string TestFormat(string format)
39 40 Thread.CurrentThread.CurrentCulture = culture;
40 41 return result;
41 42 }
42   -
43   - [Test]
44   - public void TestTimeZone()
45   - {
46   - string timeZoneOffset = DateTime.Now.ToString("zzz");
47   - Assert.That(TestFormat("%Z"), Is.EqualTo(timeZoneOffset));
48   - }
49 43 }
50 44 }
2  src/DotLiquid/Template.cs 100644 → 100755
@@ -228,7 +228,7 @@ internal static List<string> Tokenize(string source)
228 228 if (string.IsNullOrEmpty(source))
229 229 return new List<string>();
230 230
231   - source = Regex.Replace(source, string.Format(@"-({0}|{1})(\n|\r\n)", Liquid.VariableEnd, Liquid.TagEnd), "$1");
  231 + source = Regex.Replace(source, string.Format(@"-({0}|{1})(\n|\r\n|[ \t]+)?", Liquid.VariableEnd, Liquid.TagEnd), "$1");
232 232
233 233 List<string> tokens = Regex.Split(source, Liquid.TemplateParser).ToList();
234 234

0 comments on commit a345e07

Please sign in to comment.
Something went wrong with that request. Please try again.