aboutsummaryrefslogblamecommitdiffstats
path: root/testing/tests/ws.rs
blob: 3b4eb162c5b86531259bd630952b5a22fbf89da9 (plain) (tree)
1
2
3
4
5
6
7
8
9







                                                  
                      
 
                                                        























































































































































                                                                                                                                                                       





                                                                     
                        


                                       

                                                                                    






































                                                                                                                                                                                                          
// This file is auto generated by gen_ws_tests.py

use askama::Template;

macro_rules! test_template {
    ($source:literal, $rendered:expr) => {{
        #[derive(Template)]
        #[template(source = $source, ext = "txt")]
        struct CondWs;

        assert_eq!(CondWs.render().unwrap(), $rendered);
    }};
}

#[rustfmt::skip]
#[test]
fn test_cond_ws() {
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  endif  %}\n\n\n3\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n\n\n\n3");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  endif -%}\n\n\n3\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n3");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- endif  %}\n\n\n3\r\n\r\n\r\n", "\n1\r\n\n\n2\n\n\n3");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- endif -%}\n\n\n3\r\n\r\n\r\n", "\n1\r\n\n\n23");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  endif  %}\n\n\n3\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n\n\n\n3");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  endif -%}\n\n\n3\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n3");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- endif  %}\n\n\n3\r\n\r\n\r\n", "\n1\r\n2\n\n\n3");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- endif -%}\n\n\n3\r\n\r\n\r\n", "\n1\r\n23");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  endif  %}\n\n\n3\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n\n\n\n3");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  endif -%}\n\n\n3\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n3");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- endif  %}\n\n\n3\r\n\r\n\r\n", "\n1\n\n2\n\n\n3");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- endif -%}\n\n\n3\r\n\r\n\r\n", "\n1\n\n23");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  endif  %}\n\n\n3\r\n\r\n\r\n", "\n12\r\n\r\n\n\n\n3");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  endif -%}\n\n\n3\r\n\r\n\r\n", "\n12\r\n\r\n3");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- endif  %}\n\n\n3\r\n\r\n\r\n", "\n12\n\n\n3");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- endif -%}\n\n\n3\r\n\r\n\r\n", "\n123");

    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n34");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n34");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n24");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n24");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n34");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n24");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n24");
    test_template!("\n1\r\n{%  if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n34");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n34");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\r\n\r\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n34");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n24");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n24");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n\n\n\n34");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n24");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n2\n\n\n\n4");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n3\n\n\n\n4");
    test_template!("\n1\r\n{%  if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n24");
    test_template!("\n1\r\n{%  if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\r\n34");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n34");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\r\n\r\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n134");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n24");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n24");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n34");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n24");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n2\n\n\n\n4");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\n\n\n\n4");
    test_template!("\n1\r\n{%- if true  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n24");
    test_template!("\n1\r\n{%- if false  %}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n134");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n34");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\r\n\r\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%  else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n134");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n124");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n3\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n124");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else  %}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n1\n\n\n34");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n124");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%  endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\r\n\r\n\r\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n12\n\n\n\n4");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif  %}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n13\n\n\n\n4");
    test_template!("\n1\r\n{%- if true -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n124");
    test_template!("\n1\r\n{%- if false -%}\n\n2\r\n\r\n{%- else -%}\n\n\n3\r\n\r\n\r\n{%- endif -%}\n\n\n\n4\r\n\r\n\r\n\r\n", "\n134");
}

#[rustfmt::skip]
macro_rules! test_match {
    ($source:literal, $some_rendered:expr, $none_rendered:expr) => {{
        #[derive(Template)]
        #[template(source = $source, ext = "txt")]
        struct MatchWs {
            item: Option<&'static str>,
        }

        assert_eq!(MatchWs { item: Some("foo") }.render().unwrap(), $some_rendered);
        assert_eq!(MatchWs { item: None }.render().unwrap(), $none_rendered);
    }};
}

#[rustfmt::skip]
#[test]
fn test_match_ws() {
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%  when None  %}    bar     {%  endmatch  %}      after", "before   foo         after", "before     bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%  when None  %}    bar     {%- endmatch  %}      after", "before   foo         after", "before     bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%  when None -%}    bar     {%  endmatch  %}      after", "before   foo         after", "before bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%  when None -%}    bar     {%- endmatch  %}      after", "before   foo         after", "before bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%- when None  %}    bar     {%  endmatch  %}      after", "before   foo      after", "before     bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%- when None  %}    bar     {%- endmatch  %}      after", "before   foo      after", "before     bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%- when None -%}    bar     {%  endmatch  %}      after", "before   foo      after", "before bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item)  %}  foo   {%- when None -%}    bar     {%- endmatch  %}      after", "before   foo      after", "before bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%  when None  %}    bar     {%  endmatch  %}      after", "before foo         after", "before     bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%  when None  %}    bar     {%- endmatch  %}      after", "before foo         after", "before     bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%  when None -%}    bar     {%  endmatch  %}      after", "before foo         after", "before bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%  when None -%}    bar     {%- endmatch  %}      after", "before foo         after", "before bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%- when None  %}    bar     {%  endmatch  %}      after", "before foo      after", "before     bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%- when None  %}    bar     {%- endmatch  %}      after", "before foo      after", "before     bar      after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%- when None -%}    bar     {%  endmatch  %}      after", "before foo      after", "before bar           after");
    test_match!("before {%  match item  %}{%  when Some with (item) -%}  foo   {%- when None -%}    bar     {%- endmatch  %}      after", "before foo      after", "before bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%  when None  %}    bar     {%  endmatch  %}      after", "before   foo         after", "before     bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%  when None  %}    bar     {%- endmatch  %}      after", "before   foo         after", "before     bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%  when None -%}    bar     {%  endmatch  %}      after", "before   foo         after", "before bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%  when None -%}    bar     {%- endmatch  %}      after", "before   foo         after", "before bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%- when None  %}    bar     {%  endmatch  %}      after", "before   foo      after", "before     bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%- when None  %}    bar     {%- endmatch  %}      after", "before   foo      after", "before     bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%- when None -%}    bar     {%  endmatch  %}      after", "before   foo      after", "before bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item)  %}  foo   {%- when None -%}    bar     {%- endmatch  %}      after", "before   foo      after", "before bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%  when None  %}    bar     {%  endmatch  %}      after", "before foo         after", "before     bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%  when None  %}    bar     {%- endmatch  %}      after", "before foo         after", "before     bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%  when None -%}    bar     {%  endmatch  %}      after", "before foo         after", "before bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%  when None -%}    bar     {%- endmatch  %}      after", "before foo         after", "before bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%- when None  %}    bar     {%  endmatch  %}      after", "before foo      after", "before     bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%- when None  %}    bar     {%- endmatch  %}      after", "before foo      after", "before     bar      after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%- when None -%}    bar     {%  endmatch  %}      after", "before foo      after", "before bar           after");
    test_match!("before {%  match item  %}{%- when Some with (item) -%}  foo   {%- when None -%}    bar     {%- endmatch  %}      after", "before foo      after", "before bar      after");
}