1 #[test]
2 #[should_panic]
test_templates_parsed_with_line_numbers_renders_them_in_errors()3 fn test_templates_parsed_with_line_numbers_renders_them_in_errors() {
4     panic!("Implementation specific: lax errors");
5 }
6 
7 #[test]
8 #[should_panic]
test_standard_error()9 fn test_standard_error() {
10     panic!("Implementation specific: error types");
11 }
12 
13 #[test]
14 #[should_panic]
test_syntax()15 fn test_syntax() {
16     panic!("Implementation specific: error types");
17 }
18 
19 #[test]
20 #[should_panic]
test_argument()21 fn test_argument() {
22     panic!("Implementation specific: error types");
23 }
24 
25 #[test]
test_missing_endtag_parse_time_error()26 fn test_missing_endtag_parse_time_error() {
27     assert_parse_error!(" {% for a in b %} ... ");
28 }
29 
30 #[test]
test_unrecognized_operator()31 fn test_unrecognized_operator() {
32     assert_parse_error!(" {% if 1 =! 2 %}ok{% endif %} ");
33 }
34 
35 #[test]
36 #[should_panic]
test_lax_unrecognized_operator()37 fn test_lax_unrecognized_operator() {
38     panic!("Implementation specific: lax errors");
39 }
40 
41 #[test]
42 #[should_panic]
test_with_line_numbers_adds_numbers_to_parser_errors()43 fn test_with_line_numbers_adds_numbers_to_parser_errors() {
44     panic!("Implementation specific: lax errors");
45 }
46 
47 #[test]
48 #[should_panic]
test_with_line_numbers_adds_numbers_to_parser_errors_with_whitespace_trim()49 fn test_with_line_numbers_adds_numbers_to_parser_errors_with_whitespace_trim() {
50     panic!("Implementation specific: lax errors");
51 }
52 
53 #[test]
54 #[should_panic]
test_parsing_warn_with_line_numbers_adds_numbers_to_lexer_errors()55 fn test_parsing_warn_with_line_numbers_adds_numbers_to_lexer_errors() {
56     panic!("Implementation specific: lax errors");
57 }
58 
59 #[test]
test_parsing_strict_with_line_numbers_adds_numbers_to_lexer_errors()60 fn test_parsing_strict_with_line_numbers_adds_numbers_to_lexer_errors() {
61     let err = assert_parse_error!(
62         r#"
63           foobar
64 
65           {% if 1 =! 2 %}ok{% endif %}
66 
67           bla
68     "#,
69     );
70     let err = err.to_string();
71 
72     println!("err={}", err);
73     assert!(err.contains("4 |"));
74 }
75 
76 #[test]
77 #[should_panic] // liquid-rust#247
test_syntax_errors_in_nested_blocks_have_correct_line_number()78 fn test_syntax_errors_in_nested_blocks_have_correct_line_number() {
79     let err = assert_parse_error!(
80         r#"
81           foobar
82 
83           {% if 1 != 2 %}
84             {% foo %}
85           {% endif %}
86 
87           bla
88     "#,
89     );
90     let err = err.to_string();
91 
92     let expected = regex::Regex::new(r#"\bline 5\b"#).unwrap();
93     println!("err={}", err);
94     assert!(expected.is_match(&err));
95 }
96 
97 #[test]
98 #[should_panic]
test_strict_error_messages()99 fn test_strict_error_messages() {
100     panic!("Implementation specific: error format");
101 }
102 
103 #[test]
104 #[should_panic]
test_warnings()105 fn test_warnings() {
106     panic!("Implementation specific: lax errors");
107 }
108 
109 #[test]
110 #[should_panic]
test_warning_line_numbers()111 fn test_warning_line_numbers() {
112     panic!("Implementation specific: lax errors");
113 }
114 
115 #[test]
116 #[should_panic]
test_exceptions_propagate()117 fn test_exceptions_propagate() {
118     panic!("Implementation specific: error propagation");
119 }
120 
121 #[test]
122 #[should_panic]
test_default_exception_renderer_with_internal_error()123 fn test_default_exception_renderer_with_internal_error() {
124     panic!("Implementation specific: error propagation");
125 }
126 
127 #[test]
128 #[should_panic]
test_setting_default_exception_renderer()129 fn test_setting_default_exception_renderer() {
130     panic!("Implementation specific: error propagation");
131 }
132 
133 #[test]
134 #[should_panic]
test_exception_renderer_exposing_non_liquid_error()135 fn test_exception_renderer_exposing_non_liquid_error() {
136     panic!("Implementation specific: error propagation");
137 }
138 
139 #[test]
test_included_template_name_with_line_numbers()140 fn test_included_template_name_with_line_numbers() {
141     /*old_file_system = Liquid::Template.file_system
142 
143     begin
144       Liquid::Template.file_system = TestFileSystem.new
145       template = Liquid::Template.parse("Argument error:\n{% include 'product' %}", line_numbers: true)
146       page = template.render('errors' => ErrorDrop.new)
147     ensure
148       Liquid::Template.file_system = old_file_system
149     end
150     assert_equal "Argument error:\nLiquid error (product line 1): argument error", page
151     assert_equal "product", template.errors.first.template_name*/
152 }
153