|
1d647361
»
|
tobi |
2008-05-08 |
Initial github import of li... |
1 |
#!/usr/bin/env ruby |
| |
2 |
require File.dirname(__FILE__) + '/helper' |
| |
3 |
|
| |
4 |
class ParsingQuirksTest < Test::Unit::TestCase |
| |
5 |
include Liquid |
| |
6 |
|
| |
7 |
def test_error_with_css |
| |
8 |
text = %| div { font-weight: bold; } | |
| |
9 |
template = Template.parse(text) |
| |
10 |
|
| |
11 |
assert_equal text, template.render |
| |
12 |
assert_equal [String], template.root.nodelist.collect {|i| i.class} |
| |
13 |
end |
| |
14 |
|
| |
15 |
def test_raise_on_single_close_bracet |
| |
16 |
assert_raise(SyntaxError) do |
| |
17 |
Template.parse("text {{method} oh nos!") |
| |
18 |
end |
| |
19 |
end |
| |
20 |
|
|
3eddf5fb
»
|
Emmanuel Oga |
2008-07-08 |
adjusted parsing regex for ... |
21 |
def test_raise_on_label_and_no_close_bracets |
| |
22 |
assert_raise(SyntaxError) do |
| |
23 |
Template.parse("TEST {{ ") |
| |
24 |
end |
| |
25 |
end |
| |
26 |
|
| |
27 |
def test_raise_on_label_and_no_close_bracets_percent |
| |
28 |
assert_raise(SyntaxError) do |
| |
29 |
Template.parse("TEST {% ") |
| |
30 |
end |
| |
31 |
end |
|
1d647361
»
|
tobi |
2008-05-08 |
Initial github import of li... |
32 |
|
| |
33 |
def test_error_on_empty_filter |
| |
34 |
assert_nothing_raised do |
| |
35 |
Template.parse("{{test |a|b|}}") |
| |
36 |
Template.parse("{{test}}") |
| |
37 |
Template.parse("{{|test|}}") |
| |
38 |
end |
| |
39 |
end |
|
3eddf5fb
»
|
Emmanuel Oga |
2008-07-08 |
adjusted parsing regex for ... |
40 |
|
|
1d647361
»
|
tobi |
2008-05-08 |
Initial github import of li... |
41 |
end |